Open PhrozenByte opened 2 years ago
Considering that the default is to erase anything that is not explicitly kept, changing the behaviour for giving no --keep-*
option does not sound like a good idea (because that would mean "erase all").
Yeah, we could add a --keep-all
as an alias for --keep-latest <many_or_infinite>
, but that's just cosmetics.
BTW, way more important is that you still use the right --prefix
so prune stays inside the right backup set / sequence when determining the latest (checkpoint) archive of that set / sequence.
Considering that the default is to erase anything that is not explicitly kept, changing the behaviour for giving no
--keep-*
option does not sound like a good idea (because that would mean "erase all").
Just to clarify, I didn't mean to suggest that. My description might have given a false impression about that, sorry for the misunderstanding.
Yeah, we could add a
--keep-all
as an alias for--keep-latest <many_or_infinite>
, but that's just cosmetics.
Indeed. I chose to use --keep-last 1000000000
in the meantime, adding --keep-all
as an alias for --keep-last <infinite>
would be great :+1:
BTW, way more important is that you still use the right
--prefix
so prune stays inside the right backup set / sequence when determining the latest (checkpoint) archive of that set / sequence.
Thanks for the heads up! Since I use a distinct Borg repo for my manual backups it doesn't really apply to my personal use case, but you're right, for Borg repos with multiple backup sets it definitely makes a huge difference.
#edit: It's --keep-last
, not --keep-latest
, my bad :see_no_evil:
/kind enhancement
I have created a Borg repo that I use for manual backups only. Since I don't have a retention policy for this Borg repo either, I don't run
borg prune
at the moment. However, I just noticed thatborg prune
has another feature besides removing old archives according to a retention policy: removing old checkpoints.Since checkpoints aren't listed by
borg list
by default, quite a lot of checkpoints can accumulate before one notices it.Right now I can't easily remove just old checkpoints from a Borg repo; passing no
--keep-*
option toborg prune
yields the error:One can work around this error by using a very large number for
--keep-last
, e.g.--keep-last 1000000000
. Another solution is to mimicborg prune
's behaviour by usingborg list --consider-checkpoints
, a littlesed
magic andborg delete
.IMO this is a reasonable use case and Borg should support it without taking such workarounds.
Thus I'd like to suggest adding a
--keep-all
option toborg prune
, specifically tellingborg prune
not to remove any actual archive, but just old checkpoints as explained before. Passing--keep-all
with any other--keep-*
option should probably thrown an error.