Not hardlinking empty files?!

Hardy lists at steff.in
Tue Sep 1 12:14:29 UTC 2026


Hi,

with the best swiss-army-knife-like tool for copying and syncing data, I do something like:
rsync -ax --stats -x --exclude tmp --exclude .Trash-* --exclude cache2 --link-dest=/home/.shadow/dest/260901.1319.hourly . /home/.shadow
/dest/260901.1427.hourly
to create copies within the same FS with hard-linking to last version. This works as expected with one exception:
Several files are NOT linked. (I found out, because I give files with a hard-link count of 1 a special treatment.)
The files are nothing special, plain files with simple access rights, same timestamp, but happen to be zero size.
Is there a reason to omit empty files from linking?

$ rsync --version
rsync  version 3.4.1  protocol version 32

Regards
Hardy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4616 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.samba.org/pipermail/rsync/attachments/20260901/f64b93bd/smime.bin>


More information about the rsync mailing list