rsync send "non-rsync" options to the server side (--remote-option) and (--protect-args)

John Lane rsync at
Thu Nov 10 21:53:05 UTC 2016

On 29/10/16 03:14, Wayne Davison wrote:
> If you want to pass non-rsync args (etc) you should be using
> --rsync-path. The -M option is only for sending rsync-related options.

Ok, so instead of

$ rsync -av -M --customarg1=value1 -M --customarg2=value2 file1 file2
user at server:some/path

I can do

$ rsync --rsync-path='rsync --customarg1=value1 --customarg2=value2' -av
file1 file2 user at server:some/path

which works with and without --protect-args / -s. It also works with
versions of rsync prior to 3.1.0 that don't support -M (e.g. Apple Mac).

A nice thing about this is that the server side receives the arguments
the same, regardless of which method is used at the client.

I had hoped there might be something that made the additional arguments
as transparent as possible, i.e. so they could be presented the same as
other args without special treatment. But thanks for pointing me at

More information about the rsync mailing list