我在本地计算机和远程计算机上有两个相同的文件。它们的大小相等,并且本地计算机上的文件比远程计算机上的文件新-但rsync仍尝试复制文件。
我按如下方式调用rsync:
rsync -nv -e "ssh -p 2222" user@host:/data/file.fif data/file.fif
(如果我不使用-n
option,它将启动复制操作)
Rsync文档明确指出不应发生这种情况:
Rsync finds files that need to be transferred using a "quick check" algorithm (by default) that looks for files that have changed in size or in last-modified time.
来自的输出stat
:
# remote file
File: `data/fif/Skovorodko_Olga_45_raw.fif'
Size: 1137551966 Blocks: 2221784 IO Block: 4096 regular file
Device: fd00h/64768d Inode: 286338 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 1037/ platon) Gid: ( 1047/ platon)
Access: 2013-08-08 18:40:16.907581658 +0400
Modify: 2013-07-16 12:01:09.158763284 +0400
Change: 2013-07-16 12:01:09.158763284 +0400
# local file
File: `data/fif/Skovorodko_Olga_45_raw.fif'
Size: 1137551966 Blocks: 2221792 IO Block: 4096 regular file
Device: 801h/2049d Inode: 12987232 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1005/ platon) Gid: ( 1003/ platon)
Access: 2013-08-08 19:02:57.146223369 +0400
Modify: 2013-08-08 19:02:57.146223369 +0400
Change: 2013-08-08 19:02:57.146223369 +0400
为什么会这样?
更新:
执行rsync --size-only
结果文件未复制:
delta-transmission enabled
Skovorodko_Olga_45_raw.fif is uptodate
total: matches=0 hash_hits=0 false_alarms=0 data=0
sent 14 bytes received 114 bytes 85.33 bytes/sec
total size is 1137551966 speedup is 8887124.73 (DRY RUN)
-t
标志,因此它没有在新文件上设置适当的修改时间,随后的rsync调用试图更新新文件。谢谢!