borgbackup / borg

Deduplicating archiver with compression and authenticated encryption.
https://www.borgbackup.org/
Other
11.04k stars 738 forks source link

Min-Age option for `borg compact`? #8359

Open DrMaxNix opened 3 weeks ago

DrMaxNix commented 3 weeks ago

Have you checked borgbackup docs, FAQ, and open GitHub issues?

Yup

Is this a BUG / ISSUE report or a QUESTION?

QUESTION / SUGGESTION

Describe the problem you're observing.

I'm using append-only mode (borg serve --append-only) to be able to roll back changes made by a compromized client system. On the other hand I want to be able to free up unused space using borg compact. But the compact command irrecoverably deletes segments, even ones deleted a few seconds before. My proposal would be to add a --min-age option to borg compact, which allows to select a duration (eg. 2 weeks) for which segments will be ignored and never deleted. This adds a nice trade of between keeping compromized data (so you have time to detect that ou have been hacked) and not keeping everything forever (after the time duration data will de compacted as normal). I know that borg does not keep timestamps internally, but as the segment files are stored on disk, the fs will keep track of timestamps when these files have changed.

ThomasWaldmann commented 3 weeks ago

I see what you mean.

Guess I won't personally work on this though because: