Add Borg 1.4.1 feaures #1078

Closed
opened 2025-04-19 00:19:17 +00:00 by witten · 6 comments
Owner

What I'd like to do and why

Support relevant Borg 1.4.1 features and changes natively in borgmatic:

  • prune: add 13weekly and 3monthly quarterly pruning strategies
    • Maybe add borgmatic configuration options for these?
  • add BORG_USE_CHUNKS_ARCHIVE env var as a cleaner way to control whether borg shall use chunks.archive.d/ cache directory. the previous “hack” to create a non-directory file at that place is still supported.
    • Maybe add a borgmatic configuration option for this, similar to the existing options that get converted to env vars?
  • compact: support --dry-run (do nothing) to simplify scripting
    • Note: This would have to be added to borgmatic in a backwards compatible way so as not to break use of Borg 1.2.x and 1.4.0. Also check whether this is present with Borg 2.0 and support accordingly.

Other notes / implementation ideas

No response

### What I'd like to do and why Support relevant [Borg 1.4.1 features and changes](https://borgbackup.readthedocs.io/en/1.4.1/changes.html#version-1-4-1-2025-04-19) natively in borgmatic: * [ ] prune: add 13weekly and 3monthly quarterly pruning strategies * Maybe add borgmatic configuration options for these? * [ ] add BORG_USE_CHUNKS_ARCHIVE env var as a cleaner way to control whether borg shall use chunks.archive.d/ cache directory. the previous “hack” to create a non-directory file at that place is still supported. * Maybe add a borgmatic configuration option for this, similar to the existing options that get converted to env vars? * [ ] compact: support --dry-run (do nothing) to simplify scripting * Note: This would have to be added to borgmatic in a backwards compatible way so as not to break use of Borg 1.2.x and 1.4.0. Also check whether this is present with Borg 2.0 and support accordingly. ### Other notes / implementation ideas _No response_
Contributor

First: This requires only edits to to config right? Add those two options to the rest of the bunch?

Second: This needs the addition of a new env variable in environment.py, that takes the config value true/false from config right? Does it need any modification to borg compact?

Third: dry-run is currently implemented from config in borg compact so does this mean using the flag directly?
PS: I couldn't find --dry-run in borg2 common options. I will have to install borg2 in a VM and test it out.

First: This requires only edits to to config right? Add those two options to the rest of the [bunch](https://projects.torsion.org/VandalByte/borgmatic/commit/fdb08b6c56b7e2697b3b98e98b42a3d82763b07f)? Second: This needs the addition of a new env variable in `environment.py`, that takes the config value true/false from config right? Does it need any modification to `borg compact`? Third: dry-run is currently implemented from config in `borg compact` so does this mean using the flag directly? PS: I couldn't find `--dry-run` in [borg2 common options](https://borgbackup.readthedocs.io/en/master/usage/compact.html). I will have to install borg2 in a VM and test it out.
Author
Owner

First: This requires only edits to to config right? Add those two options to the rest of the bunch?

Edits to config and then passing the relevant flags to borg prune.

Second: This needs the addition of a new env variable in environment.py, that takes the config value true/false from config right? Does it need any modification to borg compact?

A new environment variable in environment.py, yes. But unless I'm missing something, I don't think it requires compact changes.

Third: dry-run is currently implemented from config in borg compact so does this mean using the flag directly?

I think it means passing --dry-run to borg compact, but only if the feature is available() in the current version of Borg in use.

PS: I couldn't find --dry-run in borg2 common options. I will have to install borg2 in a VM and test it out.

It might not be implemented yet in Borg 2.

> First: This requires only edits to to config right? Add those two options to the rest of the bunch? Edits to config and then passing the relevant flags to `borg prune`. > Second: This needs the addition of a new env variable in environment.py, that takes the config value true/false from config right? Does it need any modification to borg compact? A new environment variable in `environment.py`, yes. But unless I'm missing something, I don't think it requires `compact` changes. > Third: dry-run is currently implemented from config in borg compact so does this mean using the flag directly? I think it means passing `--dry-run` to `borg compact`, but only if the feature is `available()` in the current version of Borg in use. > PS: I couldn't find --dry-run in borg2 common options. I will have to install borg2 in a VM and test it out. It might not be implemented yet in Borg 2.
Contributor

If you haven't started the PR work for this yet, I'd be happy to take it on.

Edits to config and then passing the relevant flags to borg prune.

It's already being taken care of here, right?

flag_pairs = (
('--' + option_name.replace('_', '-'), str(value))
for option_name, value in config.items()
if option_name.startswith('keep_') and option_name != 'keep_exclude_tags'
)

If you haven't started the PR work for this yet, I'd be happy to take it on. > Edits to config and then passing the relevant flags to borg prune. It's already being taken care of here, right? https://projects.torsion.org/borgmatic-collective/borgmatic/src/commit/c3c37dee134606563cdc4e20f9d6a8b30e077ed6/borgmatic/borg/prune.py#L28-L32
Author
Owner

Oh good call.. I had forgotten about that code. Then yes, editing the configuration schema (and manually testing the new options) should be all that's necessary for this one!

I haven't started the PR on this one.. Feel free to take it!

Oh good call.. I had forgotten about that code. Then yes, editing the configuration schema (and manually testing the new options) should be all that's necessary for this one! I haven't started the PR on this one.. Feel free to take it!
Author
Owner

This is now implemented by @VandalByte in main and will be part of the next release!

This is now implemented by @VandalByte in main and will be part of the next release!
Author
Owner

Released in borgmatic 2.0.5!

Released in borgmatic 2.0.5!
Sign in to join this conversation.
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
borgmatic-collective/borgmatic#1078
No description provided.