我正在尝试使用 rsync。
一开始,一切看上去都很好:
rsync -Pniahv -e ssh /home/xxx/Videos/ [email protected]:"/shares/Public/Shared\ Videos/" --stats
...
<f+++++++++ Serien/blah.avi
<f+++++++++ Serien/blah S01E01
<f+++++++++ Serien/blah - S01E02
<f+++++++++ Serien/blah - S01E03
<f+++++++++ Serien/blah - S01E04
<f+++++++++ Serien/blah - S01E05
<f+++++++++ Serien/blah - S01E06
<f+++++++++ Serien/blah - S01E07
...
Number of files: 232
Number of files transferred: 223
Total file size: 118.24G bytes
Total transferred file size: 117.51G bytes
Literal data: 0 bytes
Matched data: 0 bytes
File list size: 9.46K
File list generation time: 0.001 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 10.18K
Total bytes received: 712
之后,我手动复制了一些文件并在干模式下再次运行 rsync:
rsync -Pniahv -e ssh /home/xxx/Videos/ [email protected]:"/shares/Public/Shared\ Videos/" --stats
...
<f..tpo.... Serien/blah.avi
<f..tpo.... Serien/blah S01E01
<f..tpo.... Serien/blah - S01E02
<f..tpo.... Serien/blah - S01E03
<f..tpo.... Serien/blah - S01E04
<f..tpo.... Serien/blah - S01E05
<f..tpo.... Serien/blah - S01E06
<f..tpo.... Serien/blah - S01E07
...
Number of files: 232
Number of files transferred: 223
Total file size: 118.24G bytes
Total transferred file size: 117.51G bytes
Literal data: 0 bytes
Matched data: 0 bytes
File list size: 9.46K
File list generation time: 0.001 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 10.18K
Total bytes received: 712
为什么--stats 中没有发生任何改变,尽管只需要更新权限和时间戳,而不需要复制完整的文件?
答案1
我不确定,但我相信当您处于试运行模式时,增量传输算法不会检查任何文件以确定是否应将其排除。由于您处于试运行模式,因此您不会看到发送/接收的字节有任何差异。
答案2
该-n
选项意味着目标中没有保存任何数据。所以,第二次就像第一次一样。