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:

This option tells rsync to apply one or more comma-separated "chmod" modes to the permission of the files in the transfer. The resulting value is treated as though it were the permissions that the sending side supplied for the file,

| improve this answer | |
  • Yes, I know. But as stated I'm looking for a solution on the debian box (server side). I have no access to the options of rsync on the synology box (client which initiates the rsync communication). – BetaRide Jan 18 '13 at 11:03

As far as I know rsync does not have such functionality. You can set your UMASK before you initiate the transfer using:

$ umask 077

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.

| improve this answer | |
  • There's no way to set this up through the synology GUI. – BetaRide Nov 5 '12 at 9:53
  • Are you doing a pull or a push rsync? I assumed you were doing a pull. – James Park-Watt Nov 5 '12 at 9:58
  • The transfer is initiated by the client (synology) box. I cannot change this, since the synology box isn't reachable from the server (debian) box. – BetaRide Nov 5 '12 at 10:01
  • @BetaRide then I'd suggest chmod -R 700 – Sammitch Oct 2 '13 at 21:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.