Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Unix 与来自的文件中的find进行rsync_Unix_Rsync - Fatal编程技术网

Unix 与来自的文件中的find进行rsync

Unix 与来自的文件中的find进行rsync,unix,rsync,Unix,Rsync,我正在尝试传输31天内更新的文件。我想跑 /bin/rsync --remove-source-files --files-from="<(find /tmp/rsync/source -type f -mtime -31 -print0)" /tmp/rsync/source /tmp/rsync/destination 试过了,这对我有好处 find /tmp/rsync/source -type f -mtime -31 | rsync -rcvh /tmp/rsync/sourc

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

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

试过了,这对我有好处

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

请您添加
find/tmp/rsync/source-type f-mtime-31
(可能只有几行)的输出好吗?我已经添加了上面查找的输出。这似乎完全忽略了查找的结果。
find /tmp/rsync/source -type f -mtime -31 | rsync -rcvh /tmp/rsync/source/ /tmp/rsync/destination/ --dry-run
/bin/rsync --recursive --remove-source-files `find /tmp/rsync/source -type f -mtime -31` /tmp/rsync/destination