rsync 有一个--hard-links
选项:
-H, --hard-links
This tells rsync to look for hard-linked files in the source and
link together the corresponding files on the destination. With-
out this option, hard-linked files in the source are treated as
though they were separate files.
但是,当我尝试将硬链接文件从一个卷复制到另一个卷时,我发现硬链接在目标位置消失了——每个硬链接文件的链接计数为 1(而不是 >=2)。
我在一个rsync
命令中将硬链接文件复制在一起。
是否有任何我遗漏或rsync
无法在目的地保留硬链接的内容?
它在这里工作。正如@xenoid 在上面的评论中暗示的那样,如果目标文件系统是 FAT32 或其他一些不支持硬链接的文件系统,您将永远无法保留硬链接。