rsync 报错:

本人是配置正确后,故意改错,而得到的报错,还有很多没有去实验,欢迎补充!


这是我的linux版本

[root@nfs01tset backupkhd]# cat /etc/redhat-release

CentOS release 6.8 (Final)

[root@nfs01tset backupkhd]# uname -r

2.6.32-642.el6.i686

[root@nfs01tset backupkhd]#



正确传输日志:


这一段排头是废话,每次传输都会有,以下的日志省略,以减少内容

2017/09/15 16:38:58 [2128] params.c:Parameter() - Ignoring badly formed line in configuration file: ignore errors

2017/09/15 16:38:58 [2128] name lookup failed for 172.16.1.32: Name or service not known

2017/09/15 16:38:58 [2128] connect from UNKNOWN (172.16.1.32)


2017/09/15 16:38:58 [2128] rsync to backup/ from rsync_backup@unknown (172.16.1.32)

2017/09/15 16:38:58 [2128] receiving file list

2017/09/15 16:38:58 [2128] ./

2017/09/15 16:38:58 [2128] sent 1998 bytes  received 4532 bytes  total size 0



报错 1、


客户端命令行:

@ERROR: auth failed on module backup  (认证模块backup失败,backup是我的模块名)

rsync error: error starting client-server protocol (code 5) at main.c(1503) [sender=3.0.6]


服务端日志:

2017/09/15 16:27:22 [2120] secrets file must not be other-accessible (see strict modes option) 机密文件不能是其他可访问的(请参阅严格模式选项)

2017/09/15 16:27:22 [2120] continuing without secrets file

2017/09/15 16:27:22 [2120] auth failed on module backup from unknown (172.16.1.32): missing secret for user "rsync_backup"


报错原因:服务端的密码文件/etc/rsync.password权限不对,600改为了644




错 2、


客户端命令行:

@ERROR: auth failed on module backup

rsync error: error starting client-server protocol (code 5) at main.c(1503) [sender=3.0.6]


服务端日志:

2017/09/15 16:42:28 [2139] secrets file must be owned by root when running as root (see strict modes) 当根目录运行时,秘密文件必须由root拥有(参见严格模式)

2017/09/15 16:42:28 [2139] continuing without secrets file

2017/09/15 16:42:28 [2139] auth failed on module backup from unknown (172.16.1.32): missing secret for user "rsync_backup"


报错原因服务端的密码文件/etc/rsync.password改成了root用户以外的其他用户(我这里是以root运行rsync的,鄙人不才,我也不知道能不能用普通用户运行,改了半天的参数,一直报错。无奈放弃。)文件的所有者不对




报错3、


客户端命令行:

@ERROR: auth failed on module backup

rsync error: error starting client-server protocol (code 5) at main.c(1503) [sender=3.0.6]


服务端日志:

2017/09/15 17:27:27 [2338] auth failed on module backup from unknown (172.16.1.32): unauthorized user 未经授权的用户


报错原因:配置文件里auth users用户认证这一项的认证错误




报错4、


客户端命令行:

@ERROR: Unknown module 'ackup'

rsync error: error starting client-server protocol (code 5) at main.c(1503) [sender=3.0.6]


服务端日志:

2017/09/15 17:31:03 [2343] unknown module 'ackup' tried from UNKNOWN (172.16.1.32)  未知的块儿设备


报错原因[backup] 块儿设备,认证错误




报错5、


客户端命令行:

rsync: failed to connect to 172.16.2.42: Connection refused (111)   拒接连接 ,(我的服务端上只允许172.16.1.0/24 连接 )

rsync error: error in socket IO (code 10) at clientserver.c(124) [sender=3.0.6]

[root@nfs01tset backupkhd]#


服务端日志:


没有服务日志,因为服务端根本就没有收到信息


报错原因IP地址不正确




报错6、


客户端命令行:

@ERROR: chdir failed

rsync error: error starting client-server protocol (code 5) at main.c(1503) [sender=3.0.6]

[root@nfs01tset backupkhd]#


服务端日志:

2017/09/15 18:33:43 [2389] rsync: chdir /backup failed  目录不存在

: No such file or directory (2)


报错原因:服务端同步数据的目录(/backup/)不存在




报错7、


客户端命令行:

[root@nfs01tset backupkhd]# rsync -avz /backupkhd/ rsync_backup@172.16.1.42::backup/ --password-file=/etc/rsync.password

sending incremental file list

./

rsync: failed to set times on "." (in backup): Operation not permitted (1)

file

file001

file002

......

......

file097

file098

file099

file100

rsync: mkstemp ".file.zomEYF" (in backup) failed: Permission denied (13)

rsync: mkstemp ".file001.QEjeC1" (in backup) failed: Permission denied (13)

rsync: mkstemp ".file002.vTYOfn" (in backup) failed: Permission denied (13)

.......

.......

rsync: mkstemp ".file097.xFqi5x" (in backup) failed: Permission denied (13)

rsync: mkstemp ".file098.EGToKT" (in backup) failed: Permission denied (13)

rsync: mkstemp ".file099.hnsvpf" (in backup) failed: Permission denied (13)

rsync: mkstemp ".file100.AMbC4A" (in backup) failed: Permission denied (13)

sent 4475 bytes  received 1930 bytes  12810.00 bytes/sec

total size is 0  speedup is 0.00

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


服务端日志:

2017/09/15 18:40:16 [2398] rsync to backup/ from rsync_backup@unknown (172.16.1.32)

2017/09/15 18:40:16 [2398] receiving file list

2017/09/15 18:40:16 [2398] rsync: failed to set times on "." (in backup): Operation not permitted (1) 不允许操作

2017/09/15 18:40:16 [2398] rsync: mkstemp ".file.zomEYF" (in backup) failed: Permission denied (13)

2017/09/15 18:40:16 [2398] rsync: mkstemp ".file001.QEjeC1" (in backup) failed: Permission denied (13)

2017/09/15 18:40:16 [2398] rsync: mkstemp ".file002.vTYOfn" (in backup) failed: Permission denied (13)

.....

.....

2017/09/15 18:40:17 [2398] rsync: mkstemp ".file097.xFqi5x" (in backup) failed: Permission denied (13)

2017/09/15 18:40:17 [2398] rsync: mkstemp ".file098.EGToKT" (in backup) failed: Permission denied (13)

2017/09/15 18:40:17 [2398] rsync: mkstemp ".file099.hnsvpf" (in backup) failed: Permission denied (13)

2017/09/15 18:40:17 [2398] rsync: mkstemp ".file100.AMbC4A" (in backup) failed: Permission denied (13)

2017/09/15 18:40:17 [2398] sent 10154 bytes  received 4532 bytes  total size 0


报错原因:这里客户端反馈的是已经传过去,但是服务端的目录不让写入(没有权限),是因为服务端的目录不是你所传输用户(我这里是rsync)所有,多以没有写权限




报错7、


客户端命令行:

@ERROR: auth failed on module backup

rsync error: error starting client-server protocol (code 5) at main.c(1503) [sender=3.0.6]


服务端日志:

2017/09/15 19:24:48 [2439] params.c:Parameter() - Ignoring badly formed line in configuration file: ignore errors

2017/09/15 19:24:48 [2439] name lookup failed for 172.16.1.32: Name or service not known

2017/09/15 19:24:48 [2439] connect from UNKNOWN (172.16.1.32)

2017/09/15 19:25:07 [2439] auth failed on module backup from unknown (172.16.1.32): password mismatch 密码不匹配


报错原因密码不匹配




报错8、


客户端命令行:

password file must not be other-accessible

continuing without password file

Password:


服务端日志:

客户端会让用户手动输入密码,根据输入密码的对错,而显示不同的日志信息


报错原因:客户端的密码文件权限不是600,服务默认是不允许其他用户能访问密码文件的。服务不会调取这样密码文件,会让你手动输入