rsync出现问题的解决方法

本文转载链接来自于:https://blog.csdn.net/Syaving_________/article/details/65437534

1、@ERRPR:chdir failed

错误原因:

服务器端没有提供访问的目录 /backup

处理方法:

需要在服务器端创建,并赋予权限rsync管理权限

mkdir /backup

chown -R rsync.rsync /backup/

2、@ERROR: auth failed on module backup

查看 服务端/etc/rsync.password 配置文件是否有问题

比如:

多余的空格 空行

rsync error: error startingclient-serverprotocol (code 5) at main.c(1503) [sender=3.0.6]

错误原因

1> 客户端密码文件的权限不是600

2> 服务端密码文件不是600

3> 服务端密码文件不存在(名字写错了/没有创建/配置文件参数写错了)

4> 服务端密码文件里保存的用户名和密码不正确

3、@ERROR:invalid uid rsync

不可用的uid

useradd rsync -s /sbin/nologin -M

4、@ERROR: chroot failed

@ERROR:chroot failed

rsyncerror: error starting client-server protocol (code 5) at main.c(1522)[receiver=3.0.3]

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

5、@ERROR: auth failed on module tee

rsync error: error starting client-serverprotocol (code 5) at main.c(1522) [receiver=3.0.3]

服务器端该模块(tee)需要验证用户名密码,但客户端没有提供正确的用户名密码,认证失败。

提供正确的用户名密码解决此问题。

6、@ERROR: Unknown module ‘tee_nonexists’

rsync error: error starting client-serverprotocol (code 5) at main.c(1522) [receiver=3.0.3]

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

1> 推送/拉取命令写错了

2> 服务端模块名字写错了

7、rsync: --passwork-file=/etc/rsync.password: unknown option

rsync: --passwork-file=/etc/rsync.password:unknown option

rsync error: syntax or usage error (code 1)at main.c(1422) [client=3.0.6]

错误原因:

/etc/rsync.password文件名称写错

解决方法:

更正/etc/rsync.password文件名称

8、rsync: ERROR:cannot stat destination

sending incremental file list

rsync: ERROR: cannot stat destination"." (in backup): Permission denied (13)

rsync error: errors selecting input/outputfiles, dirs (code 3) at main.c(554) [receiver=3.0.6]

rsync: connection unexpectedly closed (5bytes received so far) [sender]

rsync error: error in rsync protocol datastream (code 12) at io.c(600) [sender=3.0.6]

错误原因:

服务端rsync对目录操作权限不足

解决方法:

修改对应目录权限755

[root@oldboy~]# chmod 755 /backup/

[root@oldboy~]# ll -ld /backup/

drwxr-xr-x.12 rsync rsync 4096 Sep 23 19:17 /backup/

9、rsync: write failed on "/home/backup2010/ ": No space lefton device (28)

rsync:write failed on “/home/backup2010/wensong”: No space left on device(28)

rsyncerror: error in file IO (code 11) at receiver.c(302) [receiver=3.0.7]

rsync:connection unexpectedly closed (2721 bytes received so far) [generator]

rsyncerror: error in rsync protocol data stream (code 12) at io.c(601) [generator=3.0.7]

问题原因:

磁盘空间不够,所以无法操作。

解决方法:

可以通过df /home/backup2010 来查看可用空间和已用空间

10、rsync: opendir “/kexue” (in dtsChannel) failed: Permissiondenied (13)

注意查看同步的目录权限是否为755

11、rsync: failed to connect to 203.100.192.66: Connection timed out(110)

rsync:failed to connect to 203.100.192.66: Connection timed out (110)

rsyncerror: error in socket IO (code 10) at clientserver.c(124) [receiver=3.0.5]

检查服务器的端口netstat ?tunlp,远程telnet测试。

可能因为客户端或者服务端的防火墙开启 导致无法通信,可以设置规则放行 rsync(873端口) 或者直接关闭防火墙。

关服务端selinux 和iptabs 防火墙

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

需要给/etc/rsync.password 600权限

[root@backup backup]# ll -ld/etc/rsync.password

-rw-------. 1 root root 20 Sep 22 21:16/etc/rsync.password

12、rsync: failed to connect to 10.10.10.170: Connection refused (111)

rsync:failed to connect to 10.10.10.170: Connection refused (111)

rsyncerror: error in socket IO (code 10) at clientserver.c(124) [receiver=3.0.5]

启动服务:rsync --daemon–config=/etc/rsyncd.conf

13 、rsync:recv_generator: mkdir “/teacherclubBackup/rsync……” failed: No spaceleft on device (28)

*** Skipping any contents from this faileddirectory ***

磁盘空间满

14、rsync error: received SIGINT, SIGTERM, orSIGHUP (code 20) at rsync.c(544) [receiver=3.0.5]

rsyncerror: received SIGINT, SIGTERM, or SIGHUP (code 20) at rsync.c(544)[generator=3.0.5]

Ctrl+C或者大量文件

15、rsync: read error: Connection reset by peer (104)

rsync:read error: Connection reset by peer (104)

rsync error: error in rsync protocol datastream (code 12) at io.c(759) [receiver=3.0.5]

xnetid启动

查看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配置文件中。

16、rsync:recv_generator: mkdir"nfs01_172.16.1.31" (in backup) failed:Permission denied (13)

sendingincremental file list

./

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

nfs01_172.16.1.31/

rsync:recv_generator: mkdir"nfs01_172.16.1.31" (in backup) failed:Permission denied (13)

***Skipping any contents fromthis failed directory ***

sent 106bytes received 15 bytes 80.67 bytes/sec

totalsize is 655 speedup is 5.41

rsyncerror: some files/attrs were not transferred (see previous errors) (code 23) atmain.c(1039) [sender=3.0.6]

错误原因:

1、服务端配置文件中指定的用户和模块指定的目录的属主属组不同

2、服务端模块指定的目录属组属组没有权限

解决方法:

将模块指定目录的属主属组修改为 配置文件中指定的 uid gid

[root@nfs01 ~]# chown rsync.rsync/backup 配置文件中指定的用户和组

17、skippingnon-regular file “vendor/bin/doctrine”

receivingincremental file list

skippingnon-regular file “vendor/bin/doctrine”

skippingnon-regular file “vendor/bin/doctrine.php”

sent1990 bytes received 489209 bytes 327466.00 bytes/sec total size is 182515746speedup is 371.57

原因:

source源文件有软链接。

解决方法:

修改为 rsync -va,其中 -a== -rlptgoD (no -H,-A,-X) 或者 rsync -rvltOD 也可以。

解决后:

receiving incremental file list

vendor/bin/doctrine ->…/doctrine/orm/bin/doctrine

vendor/bin/doctrine.php ->…/doctrine/orm/bin/doctrine.php

sent 1998 bytes received 489279 bytes327518.00 bytes/sec total size is 182515746 speedup is 371.51

18、@ERROR: module is read only

sendingincremental file list

ERROR:module is read only

rsyncerror: syntax or usage error (code 1) at main.c(866) [receiver=3.0.6]

rsync:read error: Connection reset by peer (104)

rsyncerror: error in rsync protocol data stream (code 12) at io.c(759)[sender=3.0.6]

原因:

source源服务器端权限设置read为only只读权限。

解决方法:

read only = false

19、password file must not be other-accessible

passwordfile must not be other-accessible

passwordfile must not be other-accessible

continuingwithout password file

Password:

原因:

这是因为rsyncd.pwd rsyncd.secrets的权限不对,应该设置为600。

解决方法:

chmod 600 rsyncd.pwd

20、rsync error: error starting client-server protocol

rsyncerror: error starting client-server protocol

rsyncerror: error starting client-server protocol (code 5) at main.c(1524)[Receiver=3.0.6]

原因:

/etc/rsyncd.conf配置文件内容有错误。请正确核对配置文件。

21、 rsync: chown “” failed: Invalid argument (22)

rsync:chown “” failed: Invalid argument (22)

原因:

权限无法复制。去掉同步权限的参数即可。(这种情况多见于Linux向Windows的时候)

22、@ERROR: daemon security issue — contactadmin

@ERROR:daemon security issue — contact admin rsync error: error starting client-serverprotocol (code 5) at main.c(1530) [sender=3.0.6]

原因:

同步的目录里面有权限不足的软连接文件,需要服务器端的/etc/rsyncd.conf打开use chroot = yes。

23、rsync: read error: 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(794) [receiver=3.0.6]

解决:

很大可能是服务器端没有开启 rsync 服务,开启服务。

24、@ERROR: failed to openlock file

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

解决:

配置文件 rsync.conf 中添加lock file = rsyncd.lock 即可解决

25.在这里插入图片描述
权限不够的问题 :

将模块指定目录的属主属组修改为 配置文件中指定的 uid gid

[root@nfs01 ~]# chown rsync.rsync /backup 配置文件中指定的用户和组

服务端rsync对目录操作权限不足
报错详情
sending incremental file list

rsync: ERROR: cannot statdestination “.” (in backup): Permission denied (13)

rsync error: errors selectinginput/output files, dirs (code 3) at main.c(554) [receiver=3.0.6]

rsync: read error: Connectionreset by peer (104)

rsync error: error in rsyncprotocol data stream (code 12) at io.c(759) [sender=3.0.6]

错误原因
服务端rsync对目录操作权限不足

解决方法
修改对应目录权限为755

[root@backup ~]# chmod 755 /backup/

  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
rsync错误:some files/attrs were not transferred是指在使用rsync命令进行文件同步时出现了一些文件或属性未能成功传输的问题出现这个错误的原因可能有以下几种情况: 1. 权限不足:因为rsync需要访问和操作文件和目录,所以需要足够的权限。如果当前用户没有足够的权限,则无法传输某些文件或属性。 2. 文件不存在:若源目录中的某些文件在目标目录中不存在,rsync将无法传输这些文件。 3. 特殊文件/属性:有些文件或属性可能是特殊的,例如设备文件、符号链接等,在传输过程中可能会导致rsync错误。 解决这个问题方法是: 1. 检查权限:确保当前用户具有足够的权限来访问和操作需要传输的文件和目录。可以使用chmod或chown命令来更改文件和目录的权限。 2. 检查源和目标目录的文件是否匹配:确认源目录中的文件是否都存在于目标目录中,如果有不存在的文件,可以手动创建或复制这些文件到目标目录中。 3. 排除特殊文件/属性:通过使用rsync的--exclude选项来排除特殊文件/属性,防止它们干扰同步过程。可以根据实际情况添加正确的--exclude选项来过滤掉不需要传输的文件或属性。 总结起来,rsync错误:some files/attrs were not transferred可能是由权限问题、文件不存在或特殊文件/属性等原因引起的。通过检查权限,确认文件匹配和排除特殊文件/属性,可以解决这个问题

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值