首页 » Linux » rsync » rsync常见问题及解决办法(亲测)

rsync常见问题及解决办法(亲测)

 

rsync在使用中往往会报错误,综合自己亲身经验,总结几条错误的解决方案(IP以10.10.10.10代替):

错误一:

password file must not be other-accessible
continuing without password file
Password:
rsync客户端路径是否写错,权限设置不对,需要再次输入密码,客户端和服务端的密码文件都应该是600的权限才可以

错误二:

@ERROR: Unknown module ‘bak’
rsync error: error starting client-server protocol (code 5) at main.c(1522) [receiver= 3.0.3]
服务端server的配置中的[bak]名字和客户端client的10.10.10.10::bak不符

错误三:

rsync: failed to connect to 10.10.10.10: Connection timed out (110)
rsync error: error in socket IO (code 10) at clientserver.c(124) [receiver=3.0.6]
检查服务端server服务是否正常启动,检查端口防火墙,iptables打开873端口
如果服务端是windows server则在防火墙入站规则中增加873端口
如果服务端是Linux则先检查服务是否启动#ps aux | grep rsync
然后开启873端口#iptables -A INPUT -p tcp --dport 873 -j ACCEPT开启873端口
附:
安装rsync yum install rsync
启动服务/usr/bin/rsync --daemon
启动服务错误failed to create pid file /var/rsyncd.pid: File exists
看看提示服务错误的路径(这个路径不一定就是这个,看自己的报错路径)这里是/var/rsyncd.pid所以
rm -rf /var/rsyncd.pid;再重新启动Rsync服务
此时在看一下ps aux | grep rsync启动成功

错误四:

@ERROR: access denied to gmz88down from unknown (10.10.10.10)
rsync error: error starting client-server protocol (code 5) at main.c(1503) [receiver=3.0.6]
看看是不是服务端server hosts allow限制了IP,把这里的IP加入到服务端server的hosts allow白名单中,windows rsync不能写多个allow,可以在一个allow中加多个IP,例:hosts allow=10.10.10.10 20.20.20.20

错误五:

@ERROR: chdir failed
rsync error: error starting client-server protocol (code 5) at main.c(1503) [receiver=3.0.6]
服务端server的目录不存在或者没有权限(要同步的那个文件路径),安装windows rsync时候会创建一个SvcCWRSYNC用户,这个用户对要拷贝的目录没有权限,方法一,将这个用户给权限加入到目录中,方法二,修改这个用户隶属于的组,修改后要在管理中重启服务

错误六:

rsync error: error starting clie
nt-server protocol (code 5) at main.c(1524) [Receiver= 3.0.7 ]
/etc/rsyncd.conf配置文件内容有错误,检查下配置文件

错误七:

rsync: ch
own "" failed: Invalid argument (22)
权限无法复制,去掉同步权限的参数即可

错误八:

@ERROR: auth failed on module bak
rsync error: error starting client-server protocol (code 5) at main.c(1530) [receiver=3.0.6]
密码错误或服务器上是否有bak模块

错误九:

rsync: connection unexpectedly closed (5 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(600) [sender=3.0.6]
模块read only = no设置为no false

错误十:

@ERROR: invalid uid nobody
rsync error: error starting client-server protocol (code 5) at main.c(1503) [sender=3.0.6]
设置
uid =0
gid = 0

错误十一:

rsync: failed to connect to 10.10.10.10: No route to host (113)
rsync error: error in socket IO (code 10) at clientserver.c(124) [receiver=3.0.6]
防火墙原因

错误十二:

rsync: read error: Connection reset by peer (104)
rsync error: error in rsync protocol data stream (code 12) at io.c(759) [receiver=3.0.6]

/etc/rsyncd.conf配置文件不存在

错误十三:

rsync: Failed to exec ssh: No such file or directory (2)
rsync error: error in IPC code (code 14) at pipe.c(84) [receiver=3.0.6]
rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: error in IPC code (code 14) at io.c(600) [receiver=3.0.6]

需要在客户端安装yum install -y openssh-clients即可

错误十四:

rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1518) [generator=3.0.9]

服务端没有写权限,修改rsyncd.conf中uid和gid

错误十五:

rsync: failed to connect to 10.10.10.10 (10.10.10.10): Connection refused(111)
rsync error: error in socket IO (code 10) at clientserver.c(128) [sender=3.1.1]

rsync没启动

错误十六:

rsync: safe_read failed to read 1 bytes [Receiver]: Connection reset by4)
rsync error: error in rsync protocol data stream (code 12) at io.c(285)r=3.1.1]

server端防火墙和rsyncd.conf配置文件没有添加当前IP白名单

错误十七:

sending incremental file list
rsync: read error: Connection reset by peer (104)
rsync error: error in socket IO (code 10) at io.c(785) [sender=3.1.2]

服务端设置read only = false

错误十八:

使用rsync密钥传输时报以下错误

Unexpected remote arg: root@10.10.10.10:/home/wwwroot/blog.whsir.com
rsync error: syntax or usage error (code 1) at main.c(1201) [sender=3.0.6]

解决办法:

错误-azveP
正确-azvPe

这个报错就是顺序的问题,-e后面要跟着'ssh -p 22'

错误十九:

rsync: write failed on "123/01.jpg" (in whsir): No space left on device (28)
rsync error: error in file IO (code 11) at receiver.c(393) [receiver=3.1.2]
rsync error: error in file IO (code 11) at io.c(1633) [generator=3.1.2]

磁盘空间不足,df -h检查磁盘空间

错误二十:

@ERROR: failed to open lock file
rsync error: error starting client-server protocol (code 5) at main.c(1648) [Receiver=3.1.2]

在服务端中添加lock file = rsyncd.lock

原文链接:rsync常见问题及解决办法(亲测),转载请注明来源!

13