[Borgbackup] extended prune (was: faster / better deletion, for a bounty?)

Mario Emmenlauer mario at emmenlauer.de
Fri Dec 23 17:53:24 EST 2016


Dear All,

it seems I am pretty lucky this year to have an early Christmas
present. First, I found the large archives in my repo by pure
chance and could free 50% of disk space with only a few deletions.
Now the actual disk usage is at 1.8TB again, which matches borg's
report of deduplicated size.

Furthermore, it seems that those huge deletions where the only
"slow" ones, because later I could prune another ~200 of ~500
archives in just little over 10 minutes, with borg 1.0.9.

Finally, I seemed unable to get prune do exactly what I hoped for.
It might be me, but I did not find exactly the right combination of
options. I take backups once per week, and if they are older than
one year, I'd like to keep only every other week.
In any case I was also curious to enable prune to handle a manual
selection of archives, so I tried, and got it working pretty easily.
I extended archive.py and helper.py with two new prune options
--keep-list and --remove-list, where the former takes a list of
archives to keep (all others are pruned) and the latter takes a
list of archives to prune (all others are kept). My patch against
borg 1.0.9 is available here
   https://github.com/emmenlau/borg/tree/emmenlau_better_prune
and I'm happy to make a PR if anyone is interested (sorry for the
bold name, its really just a very minor extension to prune).


Finally, thanks a lot again for the very nice borg! Your code was
very easy to read, and I found very helpful compile instructions
in the readme! This allowed me to get productive within a few
minutes! Nice work! It would be awesome to add the pyinstaller
instructions to the readme, but they where sufficiently easy to
find in an github issue report.

Thanks, and happy holidays,

    Mario Emmenlauer


More information about the Borgbackup mailing list