Is there any way to restore/create hardlinks lost in incremental backups?
wayne at opencoder.net
Sun Dec 13 19:45:25 UTC 2020
You could rsync the current day4 dir to a day4.new dir, and list all the
prior days as --link-dest options. Make sure that you're using the same
xatt/acl options as your official backup command (the options may or may
not be present) so that you are preserving the same level of info as the
backup. You also have the choice of copying the whole day4 dir or just the
day4/pictures dir, as you see fit.
rsync -aiv --link-dest=../day1 --link-dest=../day2
--link-dest=../day3 day4/ day4.new/
mv day4 day4.bad
mv day4.new day4
If you only want to reprocess the pictures subdir, just tweak the "day4/"
arg to be "day4/pictures" (no trailing slash) and change the mv commands to
deal with just that subdir.
On Thu, Dec 10, 2020 at 9:29 AM Chris Green via rsync <rsync at lists.samba.org>
> 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
> Please use reply-all for most replies to avoid omitting the mailing list.
> To unsubscribe or change options:
> Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rsync