cygwin - 强制 rsync 按照源文件参数中列出的顺序传输文件

标签 cygwin rsync

假设您在 filelist.txt 中有一个文件列表,并像这样调用 rynsc:

$rsync --files-from=filelist.txt /path/to/source /path/to/destination

Rsync 在处理 filelist.txt 中的文件之前对其进行排序。根据 man 页面,这是为了提高传输效率。

如何将其关闭?我有一个情况,我希望以非常特定的顺序传输文件,并且我不在乎这是否会降低传输效率。

最佳答案

cat filelist.txt | xargs -n1 -I{} rsync --progress "/path-from/{}" "/path-to/{}"

这应该通过 xargs 将每个文件一次一行传递到 rsync。

可以替换

cat xxx.txt

ls -t | xargs ....

如果你愿意的话。

确实,rsync 令人烦恼地不使用您在列表中指定的顺序。

关于cygwin - 强制 rsync 按照源文件参数中列出的顺序传输文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12572643/

相关文章:

linux - 为什么这个 rsync 命令没有删除?

linux - rsync,仅包括某些文件类型,不包括某些目录

c++ - 通过 posix_spawn 进行 Rsync

linux - “C-s C-w”不起作用 - Emacs

cygwin - 在 cygwin 中循环安装

windows-7 - "Permission Denied"在 Windows 中使用 cygwin

python - 从 cygwin 运行 python 3.2 程序(windows 7 用户)

bash - 尝试在 cygwin 中运行脚本时出错

svn - 尝试让 rsync 将文件复制回 svn

vagrant - 双向 Vagrant Rsync