How do I get rsync to properly hardlink devices and symlinks? It
works fine for normal files with multiple links, but devices and
symlinks are always copied individually. I've tried 2.3.2 and 2.4.4
with the following flags:
rsync --archive \
--delete \
--exclude ".snapshot/" \
--hard-links \
--one-file-system \
--sparse \
--stats \
--whole-file \
--log-format "[%p] %t: %o %f (%b/%l)"
Source filesystem:
% ls -li
total 96
211721872 crw-r--r-- 2 root other 123,456 Aug 1 00:01 devfile1
211721872 crw-r--r-- 2 root other 123,456 Aug 1 00:01 devfile2
211721898 -rw-r--r-- 2 root other 8296 Aug 1 00:01 hardlinked
211721898 -rw-r--r-- 2 root other 8296 Aug 1 00:01 normal_file
215061002 lrwxrwxrwx 2 root other 11 Aug 1 00:02 symlink1 ->
normal_file
215061002 lrwxrwxrwx 2 root other 11 Aug 1 00:02 symlink2 ->
normal_file
Destination filesystem:
% ls -li
total 96
209351360 crw-r--r-- 1 root other 123,456 Aug 1 00:01 devfile1
209351334 crw-r--r-- 1 root other 123,456 Aug 1 00:01 devfile2
201445082 -rw-r--r-- 2 root other 8296 Aug 1 00:01 hardlinked
201445082 -rw-r--r-- 2 root other 8296 Aug 1 00:01 normal_file
209351308 lrwxrwxrwx 1 root other 11 Aug 1 00:05 symlink1 ->
normal_file
211721924 lrwxrwxrwx 1 root other 11 Aug 1 00:05 symlink2 ->
normal_file
There should only be three different inodes, but the copy has
five. 2.3.2 does not complain about the hardlinked devices, but 2.4.4
does:
stat(devfile1) : No such file or directory
stat(devfile2) : No such file or directory
Symlink modification times aren't preserved either, despite using
-a (which implies -t).
--
Brian Tao (BT300, [EMAIL PROTECTED])
"Though this be madness, yet there is method in't"