Perhaps you would like to try sysutils/clone. This preserves hard links and ACLs in the user and as well in the system namespace, while rsync preserves ACLs in user namespace only. clone(1) can be used in synchronization and in incremental mode, and there is even an option to clone a directory as hard links. This is a very nice option. It is very very fast and later you can easily find out which inodes in the original directory were removed by using find(1) for link counting.For those using rsync(1), beware that archive mode does not preserve hard links, ACLs, sparse files, or extended attributes.
This presents a serious issue for "correctness" if you are just usingrsync -av
. For example, there's a lot of hard links in FreeBSD file systems:None of these hard links are preserved by default withCode:[f13.146] $ sudo find / -mount -type f -links +1 | wc -l 15183 [f13.147] $ sudo find /usr -type f -links +1 | wc -l 13491
rsync
. And any restoration of these data would be compromised.
The emphasis thatrsync
places on performance over correctness is disappointing. Caveat emptor. I always usersync -SHAXax
.
Note, this is a shameless promotion, because I am the author of clone. On GitHub I am cyclaero.