rsync --link-dest, --delete and hard-link count

Lloyd Standish lloyd at
Sun Feb 7 15:14:59 MST 2010

On Sun, 07 Feb 2010 13:00:04 -0600, <rsync-request at> wrote:

> It's simply that rsync _can_ be made to do all this in one invocation.
> Since it has to look at and consider all three of source, prior and current
> anyways, it makes sense to enhance it with this printing capability.
>I don't have much use for userfriendly bloated scripts like dirvish/etc.
> Not to knock them, they're fine for those who use them. I just prefer
> putting only what I need into my own along with adding other bits.

I'm the author of "snap2", an rsync-based open source rotating snapshot backup shell script with (omygosh!) GUI interface via gtkdialog.  I've had to deal with the issue of reporting on files deleted between one snapshot and the previous one.

I don't think a snapshot should be deleted just because all it contains are hard links.  After all, part of the idea of a snapshot backup is to document the state of the filesystem at at certain point in time.

Still, I agree that its useful to know what files are deleted between one snapshot and the next.  Therefore, I'd also like to see a switch for rsync that works with --link-dest to make it report on missing files (compared to the hard link reference).

In the meantime, you can consider a couple of other ways to get this information:

1. Use cp -al to create the hard links instead of --link-dest.  Then when you run rsync, it will report on files "deleted."  Of course, that introduces the ownership-permissions bug (hard-linked older snapshots get ownership/permissions of newest snapshot.)

2. Run rsync "in reverse", in report-only mode (dry run).  It will look something like this: rsync -vazn /path/to/previous/snapshot/* /path/to/current/snapshot/  You will find this report quite fast to generate.  This is the approach I took in the latest version of snap2 (

Of course, rsync rocks!

More information about the rsync mailing list