Add prefix to [storage] section in config? #29
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#29
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
I'm not seeing a place to specify the prefix for a borg archive. But the [retention] section has a 'prefix' section.
Maybe there should be a 'prefix' setting under [storage]? Or maybe the 'prefix' setting needs to be moved up from [retention] into the [storage] and used for both retention and archive name during a backup?
I'm leaning towards saying that 'prefix' should be the same for both creation of the backup archive and the pruning rules.
For backwards compatibility:
https://github.com/witten/borgmatic/blob/master/borgmatic/config.py#L50
https://github.com/witten/borgmatic/blob/master/borgmatic/borg.py#L50
Imported from Taiga issue 28 (done). Created on 2017-04-10T12:24:20+0000 by Thomas Harold.
Hey Thomas,
Could you describe why you'd want a prefix option in "[storage]"? In other words, why doesn't the default prefix of "{hostname}-{timestamp}" work for your needs? Once I understand what you're trying to do, I can help figure out what the best solution is.
Thanks!
Comment on 2017-07-02T05:19:07+0000 by Dan Helfman.
Right now, as I understand the code:
There is a "prefix" option under "[prune]", so that you can tell borgmatic to only prune archives with a specific prefix. But because there's no way to specify a prefix during the creation of an archive, all archives get "{hostname}-{timestamp}" as their prefix. So it's a bit odd that I can specify a prefix for [prune], but not one for [retention] or [consistency].
Thinking a bit more, maybe "prefix" needs to move up to "[storage]" and both [retention] and [consistency] sections need to use that value unless they have their own prefix defined.
The situation where this would matter is when you have two or more borg backups writing to the same repository and you only want the consistency checks to happen against one prefix (not all prefixes).
The other would be when you have two or more borgmatic "recipes", writing to the same repo, but with different source directory sets which need different retention requirements. Because there's no "prefix" in the [storage] section, you can't override the "{hostname}" portion of the archive name with your own prefix (although I'd be happy with "{prefix}-{hostname}-{timestamp}").
Comment on 2017-07-03T13:39:51+0000 by Thomas Harold.
This is now implemented in the recently released borgmatic 1.1.7 thanks to this pull request: https://github.com/witten/borgmatic/pull/16
Basically, you can add an "archive_name_format" to the "storage" section containing the exact format and prefix you want using these placeholders: https://borgbackup.readthedocs.io/en/stable/usage.html#borg-help-placeholders
Comment on 2017-09-03T18:42:45+0000 by Dan Helfman.