raidsm wrote:Services like samba and webdav are accessing those share with another account (nobody?). At first I was assuming that a share would have the same permission that a group or user have on the directory. So after all it's normal that any directory (share) have the same permission as another mecanism (samba , webdav) grant those access. Do I understand?
Not fully
With samba or webdav,... you can never grant permissions but only degrade them
Group permissions is not fully implemented with fvdw-sl : each user linux account is also its own group. So set permission on group has not really effects.
I think some examples will be better (and I forget group action):
if file owner is root or nothing else except "nobody" and stored in a subfolder of the share "test" and we want to have an access via samba server by using a samba account "Peter".
case 1 no permission is set for 'other' => (660 or rw -rw -)
As the server can not read (or write) on this file (samba server uses the linux account "nobody") even if you allow a read access (or write) on the share "test". Peter won't be able to read (or write) the file.
case 2 you set read permission for '
other' => (664 or rw -rw -r)
Peter will be able to read only the file even if you allow a write access on the share "test" (the server can only read the file)
case 3 you set read/write permission for '
other' => (666 or rw -rw -rw)
Peter will have the permissions set on the share 'test' (either readonly or full access set by the admin for the account "Peter")
if file owner is nobody and stored in a subfolder of the share "test" and we want to have an access via samba server by using a samba account "Peter".
case 1 read/write is set for
'owner' (660 or rw-rw-)
Peter will have the permissions set on the share 'test' (either readonly or full access set by the admin for the account "Peter")
case 2 only read permission is set for
'owner' (440 or r -r -)
Peter will be able to read only the file even if you allow a write access on the share "test" (the server can only read the file)
raidsm wrote:- Code: Select all
$cmd = "umask 0 && /usr/sbin/rsync --stats --force --ignore-errors --modify-window=2 -rtv --chmod=ugo=rwX --delete '/share/1000/
10.0.1.1-smb-ATC/RaiD/' '/share/1000/NS2/RaiD'> '/share/1000/cronjobs/RaiD_";
Is there an easy way of doing it manualy in the terminal so that it keeps runing in the background even if the terminal session closed? I just need to add & at the end?
So I see you want to reuse the php script set by the backup menu is a good idea (especially if you use a remote share the script makes some tests to check is the remote share is really mounted before running the rsync)
if you look at the code you will read some other lines which adds some additional part of command string (to write in a rsync log file and put the command in background, use '&' is not enough (you need to redirect error channel)
In your command you need to keep the options l and D.
From a terminal this php script must be run like this
- Code: Select all
php /pathto..script/Rsync_xxxxx.php > /pathto..log/yourscriptlogfile
(yourscriptlogfile will contain information about fail/success script: succeed or not to start the rsync job)
This one puts the rsync command in background but I do not think it detaches the rsync child process from the terminal. So you need to use
- Code: Select all
nohup php /pathto..script/Rsync_xxxxx.php > /pathto..log/yourscriptlogfile