Native support for borg recreate (using config yaml, not arbitrary borg command line) #610
Loadingβ¦
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What I'm trying to do and why
Clean out old backups that have obsolete data so I don't have to pay more for borgbase.
Steps to reproduce (if a bug)
borgmatic -c config.yaml borg recreate --exclude 'olddata.file'
or
borgmatic -c config.yaml borg recreate --exclude 'obsoletedir/*'
Actual behavior (if a bug)
it works fine but is cumbersome
Expected behavior (if a bug)
if I had my way:
borgmatic -c config.yaml recreate
(and that's it.. updates to exclude patterns in config.yaml or referenced exclude.txt automatically take care of themselves)
e.g. in the yaml I could:
and then run borgmatic recreate and it'll refresh all those old archives.
Other notes / implementation ideas
See above. I'd like to just edit my config files and excludes and have that just "work" when doing a
borgmatic recreate
. Essentially it brings the whole repo up to date without much configuration.It would save a lot of time trying to figure out where I had backed up data I didn't actually need to back up and remove it from all archives.
Environment
borgmatic version: [1.7.4]
borgmatic installation method: [sudo pip3 install --upgrade borgmatic]
Borg version: [1.1.6]
Python version: [3.9.2]
Database version (if applicable): [N/A]
operating system and version: [Debian Bullseye (proxmox 7)]
That makes sense to me as a feature! I hadn't thought about the exclude integration before.. that's a nice idea. Thanks for taking the time to file this.
It just seemed like it was an obvious way to handle retconning my data. There's already all that exclude setup in place, why not extend it to recreate?
Incidentally, you may want to look at the other options recreate can take and how they can be implemented with config yaml changes. E.g. compression, comments, what have you.
Thanks!
This should be similar to what borgmatic does for
borgmatic create
right (except the extra arguments that borgmatic create can take)?It should take the source repos from config and overwrite them (considering the new config).
Or take one repo via
--repository
and overwrite it.And it should ignore any changes to the config that
borg recreate
does not account for?Quick links for differences between the args
borg recreate
andborg create
take -https://borgbackup.readthedocs.io/en/stable/usage/recreate.html, https://borgbackup.readthedocs.io/en/stable/usage/create.html
Also,no support for overwriting a particular archive?
Looks like an interesting task, I would like to work on it!
Will look at the other borgmatic commands.
That all sounds reasonable.
I think it could go either way. There's at least one example on the
borg recreate
docs that do this. So you could support that with a borgmatic--archive
flag if you wanted to.Any news on this? I keep creating and removing VMs and all the old VMs that I never intend to use again are lingering in my archives.
As far as I know, no one is working on this one right now. Pull requests are always welcome. π
Understood. I best get learning to code I guess.