rsync(在window端使用常见错误)

咱们都是经过错误日志查看
在rsyncd.log里面或.err文件里面,你们能够用记事本打开查看。

注意windows下面咱们须要给SvcwRsync用户,管理同步目录的全部权限,基本上这样就能够了

问题一: 
@ERROR: chroot failed 
rsync error: error starting client-server protocol (code 5) at main.c(1522) [receiver=3.0.3] 

缘由: 
服务器端的目录不存在或无权限,建立目录并修正权限可解决问题。 

问题二: 
@ERROR: auth failed on module tee 
rsync error: error starting client-server protocol (code 5) at main.c(1522) [receiver=3.0.3] 

缘由: 
服务器端该模块(tee)须要验证用户名密码,但客户端没有提供正确的用户名密码,认证失败。 
提供正确的用户名密码解决此问题。 

问题三: 
@ERROR: Unknown module ‘tee_nonexists' 
rsync error: error starting client-server protocol (code 5) at main.c(1522) [receiver=3.0.3] 

缘由: 
服务器不存在指定模块。提供正确的模块名或在服务器端修改为你要的模块以解决问题。 


问题1: 
在client上遇到问题: 
rsync -auzv --progress --password-file=/etc/rsync.pas root@192.168.133.128::backup /home/ 
rsync: could not open password file "/etc/rsync.pas": No such file or directory (2) 
Password: 
@ERROR: auth failed on module backup 
rsync error: error starting client-server protocol (code 5) at main.c(1506) [Receiver=3.0.7] 
遇到这个问题:client端没有设置/etc/rsync.pas这个文件,而在使用rsync命令的时候,加了这个参数-- 
password-file=/etc/rsync.pas 

问题2: 
rsync -auzv --progress --password-file=/etc/rsync.pas root@192.168.133.128::backup /home/ 
@ERROR: auth failed on module backup 
rsync error: error starting client-server protocol (code 5) at main.c(1506) [Receiver=3.0.7] 
遇到这个问题:client端已经设置/etc/rsync.pas这个文件,里面也设置了密码111111,和服务器一致,可是 
服务器段设置有错误,服务器端应该设置/etc/rsync.pas ,里面内容root:111111 ,这里登录名不可缺乏 

问题3: 
rsync -auzv --progress --password-file=/etc/rsync.pas root@192.168.133.128::backup /home/ 
@ERROR: chdir failed 
rsync error: error starting client-server protocol (code 5) at main.c(1506) [Receiver=3.0.7] 
遇到这个问题,是由于服务器端的/home/backup 其中backup这个目录并无设置,因此提示:chdir failed 

问题4: 
rsync: write failed on "/home/backup2010/wensong": No space left on device (28) 
rsync error: error in file IO (code 11) at receiver.c(302) [receiver=3.0.7] 
rsync: connection unexpectedly closed (2721 bytes received so far) [generator] 
rsync error: error in rsync protocol data stream (code 12) at io.c(601) [generator=3.0.7] 
磁盘空间不够,因此没法操做。 
能够经过df /home/backup2010 来查看可用空间和已用空间 

问题5:网络收集问题 
一、权限问题 
相似以下的提示:rsync: opendir "/kexue" (in dtsChannel) failed: Permission denied (13)注意查看同步的目录权限是否为755 
二、time out 
rsync: failed to connect to 203.100.192.66: Connection timed out (110) 
rsync error: error in socket IO (code 10) at clientserver.c(124) [receiver=3.0.5] 
检查服务器的端口netstat –tunlp,远程telnet测试。 
可能由于客户端或者服务端的防火墙开启 致使没法通讯,能够设置规则放行 rsync(873端口) 或者直接关闭防火墙。 

还有一种在同步过程当中可能会提示没有权限 (将同步目录加上SvcwRsync所有权限便可,更简单的方法就是将SvcwRsync设为管理员便可)


三、服务未启动 
rsync: failed to connect to 10.10.10.170: Connection refused (111) 
rsync error: error in socket IO (code 10) at clientserver.c(124) [receiver=3.0.5] 
启动服务:rsync --daemon --config=/etc/rsyncd.conf 
四、磁盘空间满 
rsync: recv_generator: mkdir "/teacherclubBackup/rsync……" failed: No space left on device (28) 
*** Skipping any contents from this failed directory *** 
五、Ctrl+C或者大量文件 
rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at rsync.c(544) [receiver=3.0.5] 
rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at rsync.c(544) [generator=3.0.5] 
六、xnetid启动 
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.5] 
查看rsync日志 
rsync: unable to open configuration file "/etc/rsyncd.conf": No such file or directory 
xnetid查找的配置文件位置默认是/etc下,根据具体状况建立软连接。例如: 
ln -s /etc/rsyncd/rsyncd.conf /etc/rsyncd.conf 
或者更改指定默认的配置文件路径,在/etc/xinetd.d/rsync配置文件中。 html

安装完 cwRsync客户端后,开始写bat 执行文件,遇到的第一件事情就是就同步到本地时 目录不认识,报错以下:

The source and destination cannot both be remote.
rsync error: syntax or usage error (code 1) at main.c(1138) [Receiver=3.0.7]

主要缘由是cwRsync 不能直接认识本地盘,必须加上 /cygdrive/g/test

意思为g:\test目录

客户端密码文件报错以下:

rsync password file must be owned by root when running as root

万能的GOOGLE告诉我,能够用一个变通的方式解决就是

@echo off
"C:\Program Files (x86)\cwRsync\bin\rsync" -rlptDzv --progress --delete "backup@192.88.88.128::test" /cygdrive/g/test --password-file=/cygdrive/g/rsync/passws.ps<g:\rsync\passwd.txt 

在g:\rsync 下创建了一个文件,写入密码,而后同步密码最后在这个文件中输入便可。如上所例。
windows

rsync问题小结

在用rsync同步数据的时候,常常会出现一些问题,我将遇到的总结以下:
一、权限问题
相似以下的提示:rsync: opendir "/kexue" (in dtsChannel) failed: Permission denied (13)注意查看同步的目录权限是否为755
二、time out
rsync: failed to connect to 203.100.192.66: Connection timed out (110)
rsync error: error in socket IO (code 10) at clientserver.c(124) [receiver=3.0.5]
检查服务器的端口netstat –tunlp,远程telnet测试。
三、服务未启动
rsync: failed to connect to 10.10.10.170: Connection refused (111)
rsync error: error in socket IO (code 10) at clientserver.c(124) [receiver=3.0.5]
启动服务:rsync --daemon --config=/etc/rsyncd.conf
四、磁盘空间满
rsync: recv_generator: mkdir "/teacherclubBackup/rsync……" failed: No space left on device (28)
*** Skipping any contents from this failed directory ***
五、Ctrl+C或者大量文件
rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at rsync.c(544) [receiver=3.0.5]
rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at rsync.c(544) [generator=3.0.5]
六、xnetid启动
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.5]
查看rsync日志
rsync: unable to open configuration file "/etc/rsyncd.conf": No such file or directory
xnetid查找的配置文件位置默认是/etc下,根据具体状况建立软连接。例如:
ln -s /etc/rsyncd/rsyncd.conf /etc/rsyncd.conf
服务器


常见错误:

错误一
rsync: failed to connect to 96.44.169.178 (*inet_ntop failed*): Connection timed
out (116)
      1 [main] rsync 3468 exception::handle: Exception: STATUS_ACCESS_VIOLATION
    740 [main] rsync 3468 open_stackdumpfile: Dumping stack trace to rsync.exe.s
tackdump
1,防火墙问题
2,端口不对

错误二
@ERROR: auth failed on module www
rsync error: error starting client-server protocol (code 5) at main.c(1516) [Rec
eiver=3.0.8]
密码不对

错误三
@ERROR: invalid uid nobody
rsync error: error starting client-server protocol (code 5) at main.c(1516) [Rec
eiver=3.0.8]
UID不对,默认是nobody
解决方法:
uid = 0
gid = 0

错误四
receiving incremental file list
rsync: read error: Connection reset by peer (104)
rsync error: error in rsync protocol data stream (code 12) at io.c(769) [receive
r=3.0.8]
rsync: connection unexpectedly closed (60 bytes received so far) [generator]
rsync error: error in rsync protocol data stream (code 12) at io.c(610) [generat
or=3.0.8]
可能缘由:
1,磁盘挂载是用异步的(async)
而后,检查了/etc/fstab ,去掉async参数。

2,我在服务器上查看日志,看到有这么一行:
rsync: unable to open configuration file "/etc/rsyncd.conf": No such file or directory

因而我:
ln -s /etc/rsyncd/rsyncd.conf /etc/rsyncd.conf

3,同步文件数较多的目录出错
有个子目录中文件较多,也就8000来个吧,老是同步一半便退出。在批处理中加上-v参数,看到错误信息以下:
rsync: writefd_unbuffered failed to write 4 bytes to socket [sender]: Connection reset by peer (104)
rsync: read error: Connection reset by peer (104)
rsync error: error in rsync protocol data stream (code 12) at io.c(768) [sender=
3.0.6]

这个问题有点头疼,在www.itefix.no网站论坛上也没能查出个因此然。

不过最终仍是在samba.org上找到解决方案:

在客户端命令行中加上--no-iconv参数就能够了。

原觉得是文件太多,缓冲区不够引发,但看这个解决方案,彷佛是转换编码方面的bug了。

在rsync的文档中描述以下:
http://rsync.samba.org/ftp/rsync/rsync.html
--iconv=CONVERT_SPEC
Rsync can convert filenames between character sets using this option. Using a CONVERT_SPEC of "." tells rsync to look up the default character-set via the locale setting. Alternately, you can fully specify what conversion to do by giving a local and a remote charset separated by a comma in the order --iconv=LOCAL,REMOTE, e.g. --iconv=utf8,iso88591. This order ensures that the option will stay the same whether you're pushing or pulling files. Finally, you can specify either --no-iconv or a CONVERT_SPEC of "-" to turn off any conversion. The default setting of this option is site-specific, and can also be affected via the RSYNC_ICONV environment variable.
网络

在window上,rsync同步数据报错:异步

rsync error: some files/attrs were not transferred (see previous errors) (code 2 3) at main.c(1052) [sender=3.0.8]socket

缘由:
async

  1. 由于rsync服务端执行的用户对同步的文件没有写入权限。ide

  2. 默认rsync是以SvcCWRSYNC此用户运行的,而通常同步的文件此用户是没有写入权限的。SvcCWRSYNC默认归属于User组。测试

  3. 将rsync的服务器端SvcCWRSYNC此用户隶属于加到administrator组就能够解决上面的报错。网站

  4. 以下图:

    wKiom1VgKqmhUnHrAADBiOsN0wI427.jpg

相关文章
相关标签/搜索