change prefix for glob_archives or create an alias glob_archives to prefix ? #588

Closed
opened 2022-09-28 03:30:11 +00:00 by hrv231 · 4 comments

What I'm trying to do and why

Hello,
I just upgraded to borg v1.2.2 and borgmatic v1.7.2

Reading the changelog from borg, I noticed that --prefix is deprecated, use -a / --glob-archives, see borgbackup #6806

--prefix still works on 1.2.x, but will not work on 2.x

example:

retention:
    keep_weekly: 3
    keep_yearly: 1
    prefix: 'myrepo-'

consistency:
    checks:
        - name: archives
    check_last: 7
    prefix: 'myrepo-'

Steps to reproduce (if a bug)

Not a bug

Actual behavior (if a bug)

Not a bug

Expected behavior (if a bug)

Other notes / implementation ideas

I would like an alias to what today is prefix or another option like glob_archives to use instead of prefix.

Right now I know that with the prefix option the yaml is calling --glob-archives, so everything is good, but would be nice to have the option by the name.

retention:
    keep_weekly: 3
    keep_yearly: 1
    glob_archives: 'myrepo-'

consistency:
    checks:
        - name: archives
    check_last: 7
    glob_archives: 'myrepo-'

Environment

borgmatic version: [1.7.2]

borgmatic installation method: [Docker container]

Borg version: [1.2.2]

Python version: [3.10.6]

Database version (if applicable): [version here]

Use psql --version or mysql --version on client and server.

operating system and version: [OS here]

#### What I'm trying to do and why Hello, I just upgraded to borg v1.2.2 and borgmatic v1.7.2 Reading the changelog from borg, I noticed that --prefix is deprecated, use -a / --glob-archives, see borgbackup [#6806](https://github.com/borgbackup/borg/issues/6806) *--prefix* still works on 1.2.x, but will not work on 2.x example: ``` retention: keep_weekly: 3 keep_yearly: 1 prefix: 'myrepo-' consistency: checks: - name: archives check_last: 7 prefix: 'myrepo-' ``` #### Steps to reproduce (if a bug) Not a bug #### Actual behavior (if a bug) Not a bug #### Expected behavior (if a bug) #### Other notes / implementation ideas I would like an alias to what today is prefix or another option like *glob_archives* to use instead of prefix. Right now I know that with the prefix option the yaml is calling --glob-archives, so everything is good, but would be nice to have the option by the name. ``` retention: keep_weekly: 3 keep_yearly: 1 glob_archives: 'myrepo-' consistency: checks: - name: archives check_last: 7 glob_archives: 'myrepo-' ``` #### Environment **borgmatic version:** [1.7.2] **borgmatic installation method:** [Docker container] **Borg version:** [1.2.2] **Python version:** [3.10.6] **Database version (if applicable):** [version here] Use `psql --version` or `mysql --version` on client and server. **operating system and version:** [OS here]
Owner

Thanks for filing this. Adding glob_archives as an option seems reasonable to me! Maybe though it shouldn't act exactly the same as prefix, so for instance you'd have to use a value of myrepo-* if you wanted the same behavior as a prefix of myrepo- ? That would also support use cases like a glob_archives value of *glob*. In any case, do you think it would make sense to error if both prefix and glob_archives are used in a configuration section?

Thanks for filing this. Adding `glob_archives` as an option seems reasonable to me! Maybe though it shouldn't act exactly the same as `prefix`, so for instance you'd have to use a value of `myrepo-*` if you wanted the same behavior as a `prefix` of `myrepo-` ? That would also support use cases like a `glob_archives` value of `*glob*`. In any case, do you think it would make sense to error if both `prefix` and `glob_archives` are used in a configuration section?
Author

No, thank you for all your hard work.

I agree with you.
I think that having an error is great in this case.

No, thank you for all your hard work. I agree with you. I think that having an error is great in this case.
Owner

Borg 2.0.0 beta 3 has just renamed --glob-archives to --match-archives, so the borgmatic option would probably be called match_archives! Additionally, the syntax has changed a bit from --glob-archives.. --match-archives supports additional pattern styles now.

Borg 2.0.0 beta 3 has just renamed `--glob-archives` to `--match-archives`, so the borgmatic option would probably be called `match_archives`! Additionally, the syntax has changed a bit from `--glob-archives`.. `--match-archives` supports additional pattern styles now.
Owner

This is implemented with a new match_archives option and will part of the next release. The documentation for this feature will appear here shortly: https://torsion.org/borgmatic/docs/how-to/make-per-application-backups/#archive-naming

Thanks for suggesting this!

This is implemented with a new `match_archives` option and will part of the next release. The documentation for this feature will appear here shortly: https://torsion.org/borgmatic/docs/how-to/make-per-application-backups/#archive-naming Thanks for suggesting this!
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#588
No description provided.