--sender and --server options

Matt McCutchen hashproduct+rsync at gmail.com
Sun May 28 03:23:42 GMT 2006


On Sun, 2006-05-28 at 02:05 +0200, myrdhin bzh wrote:
> I found a script with a rsync command. I see two
> options with this command : --server and --sender. I
> know it is internal options but i would like to
> understand the signification of these options :)

A user-invoked instance of rsync doesn't get --server and thus knows to
automatically invoke a second instance of rsync to handle the remote end
of the transfer.  The first instance passes --server to the second so
that the second knows the connection has already been set up and it only
has to read and write the remote directory.  If the first instance did
not pass --server to the second, the second would try to invoke yet
another instance of rsync, resulting in confusion.

--server may or may not be accompanied by --sender to tell the second
instance whether it is to be sender or receiver (for a pull or a push,
respectively).

It is very rare that a user script would pass --server to rsync.  I can
only think of two cases in which doing so would be useful:

(1) An --rsync-path option is given to the first rsync, causing it to
remotely invoke the script instead of the second rsync.  Now the script
needs to delegate to a real second rsync.  For some reason, instead of
passing on the options it got from the first rsync verbatim (--server
being among these options), the script constructs its own list of
options for the second rsync.

(2) The script uses an rsync instance as a helper for reading and/or
writing a file tree and talks to it using the rsync protocol.  The
script uses --server when invoking this instance.  For example, the
script might be an improved recursive "diff" program that can compare a
local directory to a remote one by using rsync to read those parts of
files in the remote directory that differ from their counterparts in the
local one.  (Such a program might be useful--has anyone written one?)

Matt



More information about the rsync mailing list