Rdiff-backup-delete

From Eugene Maker Space
Revision as of 04:22, 28 October 2016 by Clif" comment="reprev (talk | contribs) (Imported from TWiki)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Rdiff-backup is a simple and efficient backup system. Though often after you have run it for a while you find that your backup repository is running out of space because you didn't catch some tmp or cache directories that are overtaxing the the system as it tries to track all their little changes. The Rdiff-backup FAQ says the only solution is to wait for these files to expire on their own, or reduce the retention period: http://www.nongnu.org/rdiff-backup/FAQ.html#remove_dir

Serverfault has a somewhat more helpful post: http://serverfault.com/questions/97560/delete-files-from-rdiff-backup

It took awhile, but I finally got around to hacking up a script that follows the steps in that post.

It's a little bit slow in a 200G archive but what wouldn't be? If you give it a -n it will do a dry run and not delete anything, and it leaves a bunch of TMP files around (a feature) ;-) so you can diff them with the mirror-metadata files to check the results before you run it for real. Also if you put a trailing '/' on the directory to be deleted, it will just delete the contents of that dir. The code is passable but not that pretty. It would be nice to delete several things at once but that might take a rewrite. This script has saved me many tens of Gigabytes in archives that were running out of space, and as far as I can tell they haven't been corrupted. ie I can still restore odd files from them.

You might also check out rdiff-backup-regress written by Dominic Raferd. It removes one or more recent backups: http://www.timedicer.co.uk/programs/help/rdiff-backup-regress.sh.php

Enjoy,
Clif

-- Main.ClifCox - 15 Jan 2015