1

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).

BetaRide
  • 435
  • 2
  • 10
  • 20

2 Answers2

3

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,

sendmoreinfo
  • 1,742
  • 12
  • 33
  • 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
0

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.

James Park-Watt
  • 358
  • 1
  • 8