rsync远程查找前缀主目录?

分享于 

2分钟阅读

互联网

  繁體

问题:


rsync -avz --dry-run --remove-source-files --files-from=<(ssh spot@host "find /mnt/volume_2/partners/test/uploads/ -amin +10 -type f,d -print0") spot@host:. .



receiving incremental file list


rsync: [sender] link_stat "/home/spot/mnt/volume_2/partners/test/uploads" failed: No such file or directory (2)


rsync: [sender] link_stat "/home/spot/mnt/volume_2/partners/test/uploads/file-1054" failed: No such file or directory (2)


rsync: [sender] link_stat "/home/spot/mnt/volume_2/partners/test/uploads/file-1105" failed: No such file or directory (2)


rsync: [sender] link_stat "/home/spot/mnt/volume_2/partners/test/uploads/file-1105/subfile-1105" failed: No such file or directory (2)


rsync: [sender] link_stat "/home/spot/mnt/volume_2/partners/test/uploads/file-1101" failed: No such file or directory (2)


rsync: [sender] link_stat "/home/spot/mnt/volume_2/partners/test/uploads/file-1056" failed: No such file or directory (2)


rsync: [sender] link_stat "/home/spot/mnt/volume_2/partners/test/uploads/file-1058" failed: No such file or directory (2)



谢谢!


答案1:

--files-from文件

[.. ]

从文件读取的文件名都是相对于源目录

要么将绝对路径发送到files-from选项,但不要另外定义根目录(/)以外的源目录。


rsync -avz --dry-run --remove-source-files --from0 --files-from=<(ssh spot@host "find /mnt/volume_2/partners/test/uploads/ -amin +10 -type f,d -print0") spot@host:/ .




PRE  DIR  HOME  FIND  Rsync  前缀  
相关文章