borg icon indicating copy to clipboard operation
borg copied to clipboard

Please add a way to keep backups independently of pruning retention policy

Open LaurentBonnaud opened this issue 1 year ago • 2 comments

Hi, I am using borg prune to reduce the disk space used by my backups. I would like to be able to mark some backups as "not prunable" so that they are excluded from the daily/weekly/monthly retention policy that I defined. My use case for this new feature is to keep a last backup of my system before a major OS upgrade. Those upgrades are done at a point in time that is unrelated to weeks and months. Thank you for considering this suggested addition!

LaurentBonnaud avatar May 02 '24 11:05 LaurentBonnaud

This feature request is related to issue #846, but is more limited in scope and should be easier to implement.

LaurentBonnaud avatar May 02 '24 11:05 LaurentBonnaud

You can already do that by using --prefix with prune. Then simply rename the archives you do NOT want to get deleted so that they do NOT match the prefix any more.

E.g.

borg prune --dry-run --list --prefix server-backup- ...

To keep, rename archives to keep-server-backup-* .

When experimenting with prune, always use --dry-run --list for test runs before running it without --dry-run to avoid unintended data loss.

ThomasWaldmann avatar May 02 '24 12:05 ThomasWaldmann