I have a directory called data. Then I am running a script under the user id 'robot'. robot writes to the data directory and update files inside. The idea is data is open for both me and robot to update.
So I setup the permission and owner group like this
drwxrwxr-x 2 me robot-grp 4096 Jun 11 20:50 data
where both me and robot belongs to the 'robot-grp'. I change the permission and the owner group recursively like the parent directory.
I regularly upload new files into the data directory using rsync. Unfortunately, new files uploaded does not inherit the parent directory's permission as I hope. Instead it looks like this
-rw-r--r-- 1 me users 6 Jun 11 20:50 new-file.txt
When robot tries to update new-file.txt, it fails due to lack of file permission.
I'm not sure if setting umask helps. In anycase the new files does not really follow it.
$ umask -S
u=rwx,g=rx,o=rx
I'm often confounded by Unix file permission. Do I even have a right plan? I'm using Debian lenny.
sudo setfacl -Rm g:users:rwX,d:g:users:rwX /var/www/logs_or_something. Had problem with PHPUnit tests. After creating log files from running tests apache userwww-datacouldn't write/read them. – s3m3n Aug 26 '13 at 10:12setfaclman page,-bor--remove-allremoves the extended ACLs. – jww Apr 03 '14 at 00:09setfacl -Rm g:users:rwX,d:g:users:rwX data/at the end of/etc/fstab? – 425nesp Aug 03 '14 at 21:07defaultstodefaults,acl.setfaclis a command you should run from the terminal.data/should be replaced by the path to the directory you want to change. – Segfault Aug 25 '14 at 16:07