这些是我的测试文件:
$ ls -li live/
total 2048
804974 -rwxrwx--- 1 ariel ariel 1048576 Feb 22 00:45 live/file1
804975 -rwxrwx--- 1 ariel ariel 1048576 Feb 22 00:47 live/file2
和第一个备份集:
$ rsync -avix live backups/1/
sending incremental file list
created directory backups/1
cd+++++++++ live/
>f+++++++++ live/file1
>f+++++++++ live/file2
$ ls -il backups/*/live/*
804981 -rwxrwx--- 1 ariel ariel 1048576 Feb 22 00:45 backups/1/live/file1
804982 -rwxrwx--- 1 ariel ariel 1048576 Feb 22 00:47 backups/1/live/file2
我重命名file1
并查看 rsync 是否可以使用以下命令发现重命名的文件--link-dest -fuzzy --fuzzy
:
$ mv live/file1 live/File1
‘live/file1’ -> ‘live/File1’
$ rsync -avHii --debug=HLINK3,FUZZY2 --link-dest=../1 --fuzzy --fuzzy live backups/2
sending incremental file list
created directory backups/2
fuzzy size/modtime match for ../1/live/file1
fuzzy basis selected for live/File1: ../1/live/file1
cd..t...... live/
>f+++++++++ live/File1
hf live/file2
sent 1,048,997 bytes received 188 bytes 2,098,370.00 bytes/sec
total size is 2,097,152 speedup is 2.00
$ ls -il backups/*/live/*
804981 -rwxrwx--- 1 ariel ariel 1048576 Feb 22 00:45 backups/1/live/file1
804982 -rwxrwx--- 2 ariel ariel 1048576 Feb 22 00:47 backups/1/live/file2
805110 -rwxrwx--- 1 ariel ariel 1048576 Feb 22 00:45 backups/2/live/File1
804982 -rwxrwx--- 2 ariel ariel 1048576 Feb 22 00:47 backups/2/live/file2
Rsync 已链接,file2
因此给定的路径--link-dest
是正确的,并且--fuzzy --fuzzy
确实与 匹配file1
,File1
但它仍然被复制,而不是链接。为什么?