rsync常见错误排错
1.rsync:failedtoconnectto118.244.216.177:Noroutetohost(113)rsyncerror:errorinsocketIO(code10)atclientserver.c(124)[receiver=3.0.6]原因:防火墙屏蔽了端口解决:打开873段考iptables-iINPUT-ptcp--dport873-jACCEPTiptables-L如果以上指令不行,可以直接停掉防火墙/etc/init.d/iptablesstop2.@ERROR:authfailedonmodulebackuprsyncerror:errorstartingclient-serverprotocol(code5)atmain.c(1506)[Receiver=3.0.7]那估计是密码文件没有设置权限哦:chmod600/home/admin/security/rsync.pass应该差不多就可以了
:authfailedonmodulexxxxxrsync:connectionunexpectedlyclosed(90bytesreadsofar)rsyncerror:errorinrsyncprotocoldatastream(code12)atio.c(150)这是因为密码设错了,无法登入成功,请检查一下rsyncd.scrt中的密码,二端是否一致?
4.passwordfilemustnotbeother-accessiblecontinuingwithoutpasswordfilePassword:这表示rsyncd.scrt的档案权限属性不对,应设为600。
:chrootfailedrsync:connectionunexpectedlyclosed(75bytesreadsofar)rsyncerror:errorinrsyncprotocoldatastream(code12)atio.c(150)这通常是您的rsyncd.conf中的path路径所设的那个目录并不存在所致.请先用mkdir开设好要备份目录
:accessdeniedtowwwfromunknown(192.168.1.123)rsync:connectionunexpectedlyclosed(0bytesreceivedsofar)[receiver]rsyncerror:errorinrsyncprotocoldatastream(code12)atio.c(359)最后原因终于找到了。因为有两个网段都需要同步该文件夹内容,但没有在hostsallow后面添加另一个IP段hostsallow=192.168.1.0/24改为hostsallow=192.168.1.0/24192.168.2.0/24重新启动rsync服务,问题解决
:authfailedonmodulebackuprsyncerror:errorstartingclient-serverprotocol(code5)atmain.c(1506)[Receiver=3.0.7]client端没有设置/etc/rsync.pas这个文件,而在使用rsync命令的时候,加了这个参数--password-file=/etc/rsync.scrt
8.rsync:recv_generator:mkdir"/teacherclubBackup/rsync……"failed:Nospaceleftondevice(28)***Skippinganycontentsfromthisfaileddirectory***磁盘空间满了
9.rsync:opendir"/kexue"(indtsChannel)failed:Permissiondenied(13)同步目录的权限设置不对,改为755
10.rsync:readerror:Connectionresetbypeer(104)rsyncerror:errorinrsyncprotocoldatastream(code12)atio.c(759)[receiver=3.0.5]未启动xinetd守护进程[root@CC02/]#servicexinetdstart
11.rsync:unabletoopenconfigurationfile"/etc/rsyncd.conf":Nosuchfileordirectoryxnetid查找的配置文件位置默认是/etc下,在/etc下找不到rsyncd.conf文件
12.rsync:failedtoconnectto203.100.192.66:Connectiontimedout(110)rsyncerror:errorinsocketIO(code10)atclientserver.c(124)[receiver=3.0.5]连接服务器超时,检查服务器的端口netstat–tunlp,远程telnet测试
13.我需要在防火墙上开放哪些端口以适应rsync?视情况而定。rsync可以直接通过873端口的tcp连接传文件,也可以通过22端口的ssh来进行文件传递,但你也可以通过下列命令改变它的端口:rsync--port8730otherhost::或者rsync-e'ssh-p2002'otherhost:
14.我如何通过rsync只复制目录结构,忽略掉文件呢?rsync-av--include'*/'--exclude'*'source-dirdest-dir
15.为什么我总会出现"Read-onlyfilesystem"的错误呢?看看是否忘了设"readonly=no"了
:chrootfailedrsyncerror:errorstartingclient-serverprotocol(code5)atmain.c(1522)[receiver=3.0.3]原因:服务器端的目录不存在或无权限。创建目录并修正权限可解决问题。
:authfailedonmoduleteersyncerror:errorstartingclient-serverprotocol(code5)atmain.c(1522)[receiver=3.0.3]原因:服务器端该模块(tee)需要验证用户名密码,但客户端没有提供正确的用户名密码,认证失败。提供正确的用户名密码解决此问题。
:Unknownmodule‘tee_nonexists’rsyncerror:errorstartingclient-serverprotocol(code5)atmain.c(1522)[receiver=3.0.3]原因:服务器不存在指定模块。提供正确的模块名或在服务器端修改成你要的模块以解决问题。
19.权限无法复制。去掉同步权限的参数即可。(这种情况多见于Linux向Windows的时候)
详细出处参考:
排错思路:结合网友写的FAQ问题总结,客户端同步时,如果报错。首先检查端口/服务端配置文件/密码文件(配置和权限)/防火墙/服务端是否创建目录等!