chmod/chown on receiver

Wayne Davison wayned at samba.org
Tue Feb 14 16:16:16 GMT 2006


On Tue, Feb 14, 2006 at 10:17:51AM +0100, Blickwinkel wrote:
> Thanks, I was trying your hint with the su command, but somehow
> "--server"  seems to get passed to su and fails:

That is a GNU thing with them reordering options unless POSIXLY_CORRECT
is set to "1" in the environment (which is an extremely annoying thing
for a command like "su" to do).  If you are using ssh, you could put
"POSIXLY_CORRECT=1" into the ~/.ssh/environment file on the remote side,
and that should make this work.  Or you could create a script named
wwwrun, and put this in it:
    
    #!/bin/bash
    export POSIXLY_CORRECT=1
    exec /bin/su - wwwrun rsync "$@"

You'd then specify  --rsync-path=/path/wwwrun  to use it.

Alternately, you could make sure that sudo is installed and root is
authorized to use it (in the sudoers file).  Then, use this rsync
option:

    --rsync-path="sudo -u wwwrun rsync"

That works fine because sudo doesn't reorder its options.

..wayne..


More information about the rsync mailing list