Native support for borg recreate (using config yaml, not arbitrary borg command line) #610

Open
opened 2022-11-02 16:24:38 +00:00 by y8s Β· 7 comments

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:

location: 
...
  exclude_patterns:
        - /obsoletedir/*
        - /*/olddata.file

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)]

#### 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: ``` location: ... exclude_patterns: - /obsoletedir/* - /*/olddata.file ``` 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)]
Owner

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.

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.
Author

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!

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!
witten added the
good first issue
label 2023-02-04 17:16:30 +00:00
Collaborator

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 and borg 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.

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` and `borg 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.
Owner

That all sounds reasonable.

Also,no support for overwriting a particular archive?

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.

That all sounds reasonable. > Also,no support for overwriting a particular archive? 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.
Author

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.

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.
Owner

As far as I know, no one is working on this one right now. Pull requests are always welcome. πŸ˜„

As far as I know, no one is working on this one right now. Pull requests are always welcome. πŸ˜„
Author

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.

> 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.
witten added the
new feature area
label 2023-06-28 18:39:59 +00:00
Sign in to join this conversation.
No Milestone
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#610
No description provided.