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的调试消息的结尾,我得到:

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标志.我没认出–server和–sender.看看rsync手册页,果然,我在那里看不到关于–server或–sender的任何内容.那里有什么?

看看BackupPC配置,我有这个:

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.为什么要添加这些东西?这是问题的一部分吗?

解决方法

–server –sender是在管道上运行rsync时使用的选项. rsync服务器是在远程端设置的,因此它可以执行所有校验和和delta编码魔术,这样您只能通过线路传输更改的位.这可能没有在手册页中记录,因为它们是自动添加的,通常不需要知道或关心它们.

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.

相关文章

文章浏览阅读1.8k次,点赞63次,收藏54次。Linux下的目录权限...
文章浏览阅读1.6k次,点赞44次,收藏38次。关于Qt的安装、Wi...
本文介绍了使用shell脚本编写一个 Hello
文章浏览阅读1.5k次,点赞37次,收藏43次。【Linux】初识Lin...
文章浏览阅读3k次,点赞34次,收藏156次。Linux超详细笔记,...
文章浏览阅读6.8k次,点赞109次,收藏114次。【Linux】 Open...