vorta icon indicating copy to clipboard operation
vorta copied to clipboard

FR: compacting schedule like we do for pruning

Open marco44 opened this issue 2 years ago • 10 comments

The problem

I just recently upgraded to borg 1.2. The repo started growing very fast, and I learn that now we need to run compact at regular intervals to reclaim space. The compact button allowed me to recover the lost space for my repo. But I feel it should be run regularly, like we do for pruning or validation

Requested Solution

Having the possibility to compact after each backup or at regular interval.

Additional context

I saw some discussions about this in other issues about compact, but nothing clearly about this. Maybe I missed something?

marco44 avatar May 22 '23 06:05 marco44

Would fit nicely under Schedule. Similar to Validation. Ever X weeks etc.

Screenshot 2023-05-22 at 15 13 07

m3nu avatar May 22 '23 13:05 m3nu

Yeah, but which one would be better ? Like autopruning, or like validation ? I think both have their merits. I suppose borg developers had a reason for not compacting on each run...

marco44 avatar May 22 '23 15:05 marco44

I suppose borg developers had a reason for not compacting on each run...

I'd do it like validation.

real-yfprojects avatar May 22 '23 16:05 real-yfprojects

Is this something that is in line to be added at some point? Right now I have to either set a cron job or add it as a post-backup shell command, which works but isn't obvious for people setting up a new repo.

masterjuggler avatar Oct 21 '23 13:10 masterjuggler

Could be added and grouped with pruning. Like Run post-backup tasks > Prune, Compact

m3nu avatar Oct 21 '23 16:10 m3nu

If it's not a major effort to add, I think it would be worthwhile because it's something that's very easy for most people to not realize is a necessary manual step, which results in a very bloated repo.

masterjuggler avatar Oct 21 '23 21:10 masterjuggler

Would indeed be a nice feature. I noticed some unexplainable large files on my Unraid server and traced it back to my Vorta destination folder on another server. My supposedly ~5GB backup has become 262GB. I am now compacting it. Would be great to have the option to do it automatically once in a while or after each prune or something. Shouldn't be that difficult.

Gerben321 avatar Nov 18 '23 09:11 Gerben321

could be adding this command to "schedule > shell commands > post-backup" a workaround?

borg compact $repo_url

AnthillSudoku avatar Dec 16 '23 19:12 AnthillSudoku

I just put this into next milestone, this should get a high priority.

If implementing something advanced takes longer, something simple should be done ASAP so that "borg compact" is invoked. Not invoking it at all without user interaction is no good idea, backup space usage is exploding for some people until they notice they have to click on "compact" manually. If people did not set up repository quota or reserved space somehow they might even run completely out of free fs space, which is a known very bad situation with borg.

So, a quick fix would be vorta just doing a borg compact implicitly after each borg prune, no matter whether it was invoked manually or automatically.

If vorta supports borg < 1.2 still, borg compact must only be called for borg >= 1.2.

ThomasWaldmann avatar Jan 07 '24 00:01 ThomasWaldmann

Hi I'd like to work on this. Should I go for the quick fix first, by running borg compact after each prune, or start working on the scheduling?

shivansh02 avatar Mar 05 '24 15:03 shivansh02