rsync send "non-rsync" options to the server side (--remote-option) and (--protect-args)
rsync at jelmail.com
Mon Aug 1 14:14:22 UTC 2016
I have been working on a backup server where I have a server-side script
that wraps the server-side rsync invocation. I have used the client-side
rsync -M (--remote-option) to send options to the server script,
removing them from the command-line prior to invoking the server-side
rsync. This was discussed on Stack Exchange
(http://unix.stackexchange.com/questions/297143). It works well.
However, one observation is that the rsync client's -s (--protect-args)
option passes all arguments directly into the rsync server and only
sends a minimal rsync command-line to launch the server-side rsync.
This means my script does not see -M options when -s is used. It also
means that the server-side rsync receives options not intended for it
and these cause it to terminate.
I note from the man-page that the -s option "will eventually become a
new default setting at some as-yet-undetermined point in the future".
When that happens, it will break what I have above.
So, a couple of questions:
* is using -M the right way to send non-rsync options to the server side ?
* could it be considered for -s to not affect non-rsync options that
have been specified with -M ?
Thanks for your attention.
More information about the rsync