how to unbungle a bad backup

Ben Escoto
Sun, 14 Apr 2002 19:49:19 -0500

Jamie Heilman wrote:

>So - without going into the sordid details, (lets just say I fell
>asleep before I was able to something that really needed to be done)
>I've got myself into a nice spot.  My source directory which was
>normally ~60G of files kinda got replaced by something that was only
>about ~60M and as such didn't contain anywhere near the amount of
>files it should have.  But rdiff-backup ran and tried to accomodate
>the differences, but it ran out of space for the massive amount of
>incrementals that it would have needed.  Now I'm left with a rather
>harshed backup directory.  I removed about 5 days of incrementals to
>get some space back on the partition, and I fixed my source directory
>so it has what it should have had in it.  Now how do I convince
>rdiff-backup to rollback what it tried to do the day before and
>couldn't finish so I can create a new set of incrementals from the
>correct data?  Or should I just invalidate the last 30 days of
>incrementals and start over after putting on my hair-shirt and going
>for a jog?
Let's introduce some names:

t - the time of the last good backup
A - the state of the source directory at the time t
B - state of the rdiff-backup target directory right after t
C - current state of rdiff-backup target directory

So B = A + increments older than t, and you want to recover B, to 
pretend that the bad backup never happened?  So in theory after 
rdiff-backup failed because of lack of space, you still should have been 
able to recover A, because C should still be in a consistent state.  If 
you want to reconstruct B, and you have enough space, it seems like you 
can get B by first restoring A using C, and then making an 
rdiff-backup-data directory under A, copying all the increments from C 
to A/rdiff-backup-data except the most recent ones made while you were 
asleep.  (All the bad increments should contain something like 
2002-04-13_03:44:23 or whatever, so they should be easy to exclude.)

So anyway, if you have the space and want to spend the time it seems you 
can recover B from C, but I don't know of a natural way of doing it. 
 For a while I've wanted an rdiff-backup feature where it could delete 
increments other than the oldest ones, but I keep hoping the rdiff 
people will make it much easier on me by adding a 'compose diff' 
feature, where two diffs can be composed to create a third without any 
of the original files.

Ben Escoto