86
46
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.
So, you would just append
setfacl -Rm g:users:rwX,d:g:users:rwX data/
at the end of/etc/fstab
? – 425nesp – 2014-08-03T21:07:56.513@piña no. the only change you make to /etc/fstab is to change
defaults
todefaults,acl
.setfacl
is a command you should run from the terminal.data/
should be replaced by the path to the directory you want to change. – Segfault – 2014-08-25T16:07:32.343I used this command but it didn't fix my problem, how can i undo this command please? – Itai Ganot – 2013-08-15T09:37:56.750
Did the trick on ubuntu with
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-data
couldn't write/read them. – s3m3n – 2013-08-26T10:12:47.7702
@Itai Ganot - according to the
– jww – 2014-04-03T00:09:53.710setfacl
man page,-b
or--remove-all
removes the extended ACLs.