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

Skip to first unread message

John Lane

Aug 1, 2016, 10:37:25 AM8/1/16
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
( 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.

Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options:
Before posting, read:

Reply all
Reply to author
0 new messages