chmod/chown on receiver

Jamie Lokier jamie at shareable.org
Wed Feb 15 21:06:52 GMT 2006


Wayne Davison wrote:
> 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.

I agree, it's annoying for a program like su.  I think it should be
reported to GNU as a bug in su.

You can also use the "--" option with GNU programs to prevent
interpreting options after "--", and then POSIXLY_CORRECT isn't
required, like this which is simpler than the above:

    #!/bin/bash
    exec /bin/su - wwwrun -- rsync "$@"

-- Jamie


More information about the rsync mailing list