I'm transfering data from a synology box to a debian box with rsync.
Unfortunately the permissions of all transfered files are set to rwxrwxrwx
on the debian box. I want to make sure this files can be seen by the owning user only. Is there a way to tell the debian box to set the permissions to something like rwx------
?
The rsync job is set-up through the DSM GUI. If possible I'd rather avoid hacking the synology box and do something on the command line. This means I'm looking for a way to set the permissions on the server side (debian box). I'm using the latest DSM version (4.1).
rsync (3.0.9, at least) has a
--chmod
option, here's what it does:As far as I know rsync does not have such functionality. You can set your UMASK before you initiate the transfer using:
Then perform the rsync transfer. Make sure you are not using the preserve permissions switch (-p) or anything that sets preserve permissions e.g. -a. If you are using this as part of a script and using a subshell you do not need to reset the umask as when the shell exits it will revert. If you will continue using the shell i recommend that you restore your umask to a more permissive setting such as 022.