BackupPC – 为什么使用rsync –sender –server …?

我正在使用CentOS 5.5服务器上的BackupPC进行试验。 我有几乎所有的默认值设置。

我试图设置主机的/ www目录的基本备份。 备份失败,出现以下错误:

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) 

首先,是的,我有我的SSH密钥设置,让我ssh到目标服务器,而不需要密码。

在排除故障的过程中,我直接从命令行尝试了上面的ssh命令,并挂起。 查看SSH的debugging信息的结尾,我得到:

 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 

接下来我开始看着rsync标志。 我没有认识到 – 服务器和 – --sender 。 看看rsync手册页,果然,我没有看到关于 – 服务器或--sender在那里的任何东西。 那里有什么?

看着BackupPCconfiguration我有这样的:

 RsyncClientPath = /usr/bin/rsync RsyncClientCmd = $sshPath -q -x -l root $host $rsyncPath $argList+ 

而对于论点,我有以下列出:

 --numeric-ids --perms --owner --group -D --links --hard-links --times --block-size=2048 --recursive 

注意没有--server ,– --sender或者--ignore-times 。 为什么这些东西被join? 这是问题的一部分吗?

--server --sender是在pipe道上运行rsync时使用的选项。 rsync服务器设置在远程端,这样它就可以完成所有的校验和和增量编码魔术,所以你只能通过线路传输改变的比特。 这可能没有logging在手册页中,因为它们是自动添加的,通常不需要知道或关心它们。

从man rsync(1)

选项–server和–sender由rsync内部使用,在正常情况下不应该由用户键入。 在某些情况下可能需要了解这些选项,例如设置只能运行rsync命令的login。 例如,rsync发行版的支持目录中有一个名为rrsync的示例脚本(用于受限制的rsync),可以与受限制的sshlogin一起使用。

从我的手册:

选项–server和–sender由rsync内部使用,在正常情况下不应该由用户键入。 在某些情况下可能需要了解这些选项,例如设置只能运行rsync命令的login。 例如,rsync发行版的支持目录中有一个名为rrsync的示例脚本(用于受限制的rsync),可以与受限制的sshlogin一起使用。

如果不运行持久性rsync服务器(使用rsyncd.conf和rsync --daemon ),则rsync需要在连接的远程端创build自己的服务器来检查文件并执行散列等。