Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

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,

share|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
    
+1 This helped me. Thanks! –  mkoistinen Dec 7 '13 at 21:05

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.

share|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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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