Is there any way to restore/create hardlinks lost in incremental backups?

Chris Green cl at
Thu Dec 10 17:05:01 UTC 2020

I run a simple self written incremental backup system using rsync's
--link-dest option.

Occasionally, because I've moved things around or because I've done
something else that breaks things, the hard links aren't created as
they should be and I get a very space consuming backup increment.

Is there any easy way that one can restore hard links in the *middle*
of a series?  For example say I have:-


and I notice that day4/pictures is using as much space as
day1/pictures but all the others are relatively small, i.e.
day2 day3 and day5 have correctly hard linked to the previous day but
day4 hasn't.

It needs a tool that can scan day4, check a file is identical with the
one in day3 then hardlink it without losing the link from day5.

There's jdupes but that does lose the link from day5 so you'd have to
apply it to all the directories after the one that's lost the links.

Chris Green

More information about the rsync mailing list