Run a pre backup hook only once when working with multiple configuration files #353
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#353
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 push the same backup to two different places, one onsite and one externally. However I need completely different settings for retentions, repo url and even executable name so I use two configuration files in /etc/borgmatic.d.
This works as intenteded. However, I also need to dump a large and complex application to disk using its own backup utility. This is done using a pre backup hook. This also works as intended. However, this backup is very demanding, and because it is run once for every configuration it is very inefficient.
What I am asking for is the possibility to configure a hook to only run once before all the backups. E.g. some kind of additional hook that is always interpreted as a global hook, regardless of which config file it is found in.
Check out the
before_everything
hook in the configuration. I think it'll do exactly what you're looking for! Either way, please do let me know. Thanks!Sorry for wasting your time! For some reason I thought the "hooks" part of the configuration documentation stopped at the postgresql part. My mistake!
It worked like a charm!
I'm really glad to hear it worked! I only had to travel back in time to implement the feature before you asked for it. ;)
I've also updated the schema so that these hooks are easier to find.