rsync 报错: rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main

1 rsync 报错:

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

根据别人的经验,rsync error: some files/attrs were not transferred 和 http://www.lingzhong.cn/tech/23765.htm

方法1 是修改配置文件,方法2是更改权限。

第一种试了有些麻烦,第二种太夸张了。

这个时候再跑一遍同步,

linlf@ccrfox247:~/project/man$ ./transfer-cuda90.sh 
jingwei@172.16.0.xxx's password: 
sending incremental file list
rsync: send_files failed to open "/home/linlf/project/nohup.out": Permission denied (13)

sent 20,428,254 bytes  received 232 bytes  1,634,278.88 bytes/sec
total size is 211,679,681,443  speedup is 10,361.99
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1183) [sender=3.1.1]

 

列出了那个文件无法同步。原来这个文件的owner和group都是root,而我同步过去的用户是普通用户,不是root,因此报错。

ls -lh /home/linlf/project/nohup.out
-rw------- 1 root root 207K 6月  14 17:27 /home/linlf/project/nohup.out

修改方法也很简单,把这个文件权限改成我自己的:

sudo chown linlf /home/linlf/project/nohup.out
sudo chgrp linlf /home/linlf/project/nohup.out

最后干脆把待同步的文件夹一并修改权限:

sudo chown -R linlf /home/linlf/project
sudo chgrp -R linlf /home/linlf/project

再运行脚本:

rsync -avz /home/linlf/project jingwei@xxx.xx.x.xxx:/home/linlf

done!

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值