Question says it all:
What happens if rsnapshot or rdiff-backup gets interrupted in the middle of a transfer?
I know that rsnapshot tries to make a complete snapshot of your system in rotating fashion, and rdiff-backup makes a differential backup, which is going to be based on the files previously saved behind it.
So: What happens if it gets interrupted in the middle?
Does this result in an "incomplete snapshot"?
Will other snapshots which are dependent on this one be corrupted? (Surely not, but... ?)
My understanding is that...
rdiff-backup will detect the incomplete increment the next time it runs. It will delete the incomplete increment so that the backup location is the same as if the interrupted backup attempt had never been started.
rsnapshot is a little more complicated because its routine is more stepwise and varies depending on the use of the
sync_first
anduse_lazy_deletes
options.sync_first
andrsnapshot sync
gets interrupted, you can simply runrsnapshot sync
again to straighten things out. If you accidentally runrsnapshot <backup level>
at this point instead, the latest backup point will remain incomplete and will be carried through rotations.sync_first
, you're just stuck with an incomplete backup point that is a hybrid of old and new version of files. Unless you manually reverse-rotate each backup point, the incomplete backup point will be carried through rotations.rsnapshot <backup level>
will cause the oldest backup point to be lost unlessuse_lazy_deletes
is enabled.Note that
sync_first
anduse_lazy_deletes
come at the cost of using more disk space.A reminder/disclaimer: This should go without saying, but never just blindly trust others' advice on the internet. If you plan to use rdiff-backup or rsnapshot for something mission-critical, read every word of the manual and test, test, test everything yourself!
That just happened to me. my external drive became full half-way through rsnapshot's incremental backup:
Now I'd like to share a couple of things I learnt from this. ie to repair and limit considerabily chances for such a case to bite me back ;)
Resume a Rsnapshot's interrupted backup
I know two ways to roll back that safely.
Manually
Automatically
rsnapshot has no pause/stop and resume capabilities (except for the limited "skipped due to rollback plan" 2), so we have to use a wrapper to handle these features.
rsnapshot-once
3 by Philipp C. Heckel is a wrapper for rsnapshot in PHP that:Using it for a year I am a happy user: I edited php.ini's
openbase_dir
for my backup need and voila, lucky day ^_^ Smoother and safer than my previous raw rsnapshot based solution.Note: slm linked me here from duplicate question: Rsnapshot destination full - how to safely rerun?