BackupPC - why does it use rsync --sender --server ...?
I'm in the process of experimenting with BackupPC on a CentOS 5.5 server. I have everything pretty much setup with default values.
I tried setting up a basic backup for a host's /www directory. The backup fails with the following errors:
full backup started for directory /www
Running: /usr/bin/ssh -q -x -l root target /usr/bin/rsync --server --sender --numeric-ids --perms --owner --group -D --links --hard-links --times --block-size=2048 --recursive --ignore-times . /www/
Xfer PIDs are now 30395
Read EOF: Connection reset by peer
Tried again: got 0 bytes
Done: 0 files, 0 bytes
Got fatal error during xfer (Unable to read 4 bytes)
Backup aborted (Unable to read 4 bytes)
Not saving this as a partial backup since it has fewer files than the prior one (got 0 and 0 files versus 0)
First of all, yes I have my ssh keys setup to allow me to ssh to the target server without requiring a password.
In the process of troubleshooting, I tried the above ssh command directly from the command line, and it hangs. Looking at the end of the debug messages for SSH I get:
debug1: Sending subsystem: /usr/bin/rsync --server --sender --numeric-ids --perms --owner --group -D --links --hard-links --times --block-size=2048 --recursive --ignore-times . /www/
Request for subsystem '/usr/bin/rsync --server --sender --numeric-ids --perms --owner --group -D --links --hard-links --times --block-size=2048 --recursive --ignore-times . /www/' failed on channel 0
Next I started looking at the rsync flags. I did not recognize --server
and --sender
. Looking at the rsync man pages, sure enough, I don't see anything about --server
or --sender
in there. What are those in there for?
Looking at the BackupPC config I have this:
RsyncClientPath = /usr/bin/rsync
RsyncClientCmd = $sshPath -q -x -l root $host $rsyncPath $argList+
And for the arguments, I have the following listed:
--numeric-ids
--perms
--owner
--group
-D
--links
--hard-links
--times
--block-size=2048
--recursive
Notice there is no --server
, --sender
or --ignore-times
. Why are these things getting added in? Is this part of the problem?
The --server --sender
are options that used when you are running rsync over a pipe. The rsync server is setup on the remote side so that it can do all checksum and delta-encoding magic so that you are only transferring the changed bits over the wire. This are probably not documented in the man page since they are automatically added, and usually don't need to know or care about them.
From man rsync(1)
The options --server and --sender are used internally by rsync, and should never be typed by a user under normal circumstances. Some awareness of these options may be needed in certain scenarios, such as when setting up a login that can only run an rsync command. For instance, the support directory of the rsync distribution has an example script named rrsync (for restricted rsync) that can be used with a restricted ssh login.
From my manpage:
The options --server and --sender are used internally by rsync, and should never be typed by a user under normal circumstances. Some awareness of these options may be needed in certain scenarios, such as when setting up a login that can only run an rsync command. For instance, the support directory of the rsync distribution has an example script named rrsync (for restricted rsync) that can be used with a restricted ssh login.
When you don't run a persistent rsync server (using rsyncd.conf and rsync --daemon
) then rsync needs to create its own server on the remote end of the connection to examine the files and perform the hashing and so on.