与文件中的查找同步

我正在尝试传输在31天内已更新的文件。我正在尝试

/bin/rsync --remove-source-files --files-from="<(find /tmp/rsync/source -type f -mtime -31 -print0)" /tmp/rsync/source /tmp/rsync/destination

但是,尝试此操作时,我不断收到以下错误:

failed to open files-from file <(find /tmp/rsync/source -type f -mtime -31 -print0): No such file or directory

该目录存在并且可以访问。

这是查找结果的输出:

$ find /tmp/rsync/source -type f -mtime -31  
/tmp/rsync/source/testfile2.txt  
/tmp/rsync/source/testfile.txt  
/tmp/rsync/source/sourcefile.txt
js20090617 回答:与文件中的查找同步

尝试过,这对我有用

find /tmp/rsync/source -type f -mtime -31 | rsync -rcvh /tmp/rsync/source/ /tmp/rsync/destination/ --dry-run

删除空运行以实际执行

,

由于我被迫使用一个预先存在的脚本,该脚本在“ {”括号中进行解析,并且您无法在rsync脚本之前运行命令的地方,所以我无法使用上述解决方案。

但是我能够使用以下内容使其正常工作:

/bin/rsync --recursive --remove-source-files `find /tmp/rsync/source -type f -mtime -31` /tmp/rsync/destination
本文链接:https://www.f2er.com/2934973.html

大家都在问