unified borgmatic command to trigger actions (prune or not) from what is in the config file #701
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#701
Loading…
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
Run a repository in append-only mode, with a cron on the repository server to prune.
I want to be able to run "borgmatic" command to performs all tasks without the need to explictily limit to "prune" subcommand.
If I run borgmatic on the repository server, I will create a backup of the repository server, on the client repository.
Repository server side
Current config file to be able to borgmatic prune
Create a borgmatic file on the repository in /etc/borgmatic.d/prune-hostname.yml
Then run
if I run
borgmatic
alone, this will have an non wanted behaviour (backuping the repository server in the client repository)Expected config file and behaviour
Then run
client side
Current config file to be able to create a backup
Then, to be able to create a backup without pruning, I need to run
Expected config file and behaviour
If no
retention
key is specified in the config file, the following command should work.The benefit is that this will also borgmatic check without the need to explicit it.
Other notes / implementation ideas
Environment
borgmatic version: 1.7.8
Borg version: borg 1.2.4
The other problem is that I cron my backup on the client, and that I backup on two different repositories.
Repository 1 runs in
--append-only
mode, but not Repository 2.I monitor return code of borgmatic command.
If I explicitly run
borgmatic create && borgmatic check
, I will backup and check on repository 1 and repository 2, but will not prune on repository 2.If I run
borgmatic
, prune will fail on Repository 1.I should be able to run
borgmatic
command to automate what I need on specific repositories.With the version I run, I can't prune per repository to workaround this.
EDIT : updated to be able to use
--repository
withprune
subcommandhttps://github.com/void-linux/void-packages/pull/43872
Thank you for taking the time to file this! I totally agree that having the ability to run "prune only" or "check only" would be nice without having to specify that on the command-line every time. I'm not sure though about having borgmatic try to figure out what actions to run based on the configured section of the configuration file. I say that because sometimes a configuration section isn't specified but has defaults anyway. For instance, even when
consistency
isn't specified, borgmatic assumes a default set of checks with a default frequency.An alternate approach to allow what you're asking for—to be able to just run
borgmatic
without explicit actions—would be to put those explicit actions in the configuration file (optionally). For instance:Then, if you didn't override those actions on the command-line, they would be used when running borgmatic and no other actions would run (for that configuration file).
Related ticket: #364.
Let me know your thoughts on whether this would address your use case!
Yes, the solution about the ability to explicitly limit actions in config file seems perfect to me !
A couple of challenges I encountered with this one so far:
Okay, here's the solution I came up with to sidestep those challenges: Instead of a configuration option with the default actions to use, I flipped the logic and added a "skip_actions" option with names of the actions that should be skipped for the current configuration file. Example:
I feel like this pretty well supports the original append-only use case and also other use cases like a checkless configuration.
This is implemented in main and will be part of the next release!
Just released as part of borgmatic 1.8.5!
I'll test this, thanks a lot for your work !