I have a directory owned by root, after I copy files into it. All exe files can only be run as root. But I would like everyone to be able to run it.Surely, I can use chmod -R u=rwX,g=rX,o=rX every time after I add new files into it. However, this is very annoying. Is there any thing I can set in the directory to automatically allow all users to run the exe?
set all executable files executable by all users but leave un-executable file non-executable?
permissions;acl;umask
Using umask 0022 before making the copy, you will get all new files with -rw-r--r-- permissions by default, but files can be made executable only invoking directly chmod +x on them.You can use the abbreviated command: chmod -R a+rX directory to do it manually.To automatically set all file permissions you can use inotifywait like that:inotifywait -qm <directory> -e create -e moved_to -e modify \ | while read a b c; do chmod a+rX ${a}${c}; done