rsync icon indicating copy to clipboard operation
rsync copied to clipboard

ignore-existing with hardlinks

Open ynikitenko opened this issue 3 years ago • 0 comments

I store several versions of my directory in snapshots (called commits), these are just hard links to files in the original directory. I don't want to pull actual changes (if there were any), and I add --ignore-existing to rsync options,

rsync -avH -P --delete-after --ignore-existing --include=/.ys/commits --include=/.ys/logs --exclude=/.ys/* src/ dest/

Unfortunately, in this case all hard links for newer snapshots are broken (and when I drop this option, they are preserved). As I understand, it follows from the fact that --ignore-existing is a transfer rule, so all other (existing) hard links are ignored by rsync, and the snapshot is created anew.

Do I understand this right? Can I preserve all hard links and simultaneously ignore any changes in existing files?

ynikitenko avatar Aug 17 '22 10:08 ynikitenko