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 
[email protected]'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 [email protected]:/home/linlf

done!

你可能感兴趣的:(计算资源管理,rsync)