我正在尝试通过从Asustor NAS到我的Ubuntu服务器的远程shell连接来运行rsync。NAS的命令不可能更改,因为它是从web接口运行的。但是我知道正在运行的命令,我可以手动测试它,这会产生一个错误。当我从NAS运行它时,它看起来是这样的:
$ /usr/builtin/bin/rsync -e "/usr/bin/ssh -l ssh-user-on-my-server -p 12345" --progress -a --timeout=60 rsync://rsync-user-on-my-server@myserver.com:873/rsync-module
ssh-user-on-my-server@myserver.com's password:
rsync: server sent "2017/01/17 19:38:58 [6920] connect from xxx-xxx-xxx-xxx-url-to-the-nas.com (xxx.xxx.xxx.xxx)" rather than greeting
rsync error: error starting client-server protocol (code 5) at /asustor/branch2_6_2016_09_22/x64_g1/source/rsync-3.0.9/main.c(1649) [Receiver=3.0.9]我碰巧注意到,上面的消息与rsyncd中的日志格式完全一样。这是在不使用SSH的情况下从NAS运行rsync到我的Ubuntu服务器时来自rsyncd的一个示例输出:
2017/01/06 23:42:13 [5979] connect from xxx-xxx-xxx-xxx-url-to-the-nas.com (xxx.xxx.xxx.xxx)
2017/01/06 22:42:13 [5979] rsync on rsync-module/ from rsync-user@xxx-xxx-xxx-xxx-url-to-the-nas.com (xxx.xxx.xxx.xxx)
2017/01/06 22:42:13 [5979] building file list
2017/01/06 22:42:14 [5979] sent 172 bytes received 24 bytes total size我已经验证了SSH和rsync都是独立工作的,这个问题只有在我尝试运行脚本时才会发生,即通过远程shell连接进行rsync。
这看起来很像更改主机IP后不使用ssh和root的Rsync,但问题是来自.bashrc的问候语。
发布于 2017-01-20 19:03:56
我自己找到了答案。正如我所说,rsync抱怨的输出看起来与rsync日志完全一样。问题是我的rsyncd.conf。我是通过为rsync服务构建一个码头来开始这个项目的。为了从我的码头获得反馈,我在我的配置文件中添加了以下行:log file = /dev/stdout。rsync守护进程直接将日志打印到stdout!
https://serverfault.com/questions/826854
复制相似问题