Run a pre backup hook only once when working with multiple configuration files #353

Closed
opened 2020-08-12 07:35:38 +00:00 by hk · 3 comments

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.

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.
Owner

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!

Check out the `before_everything` hook in the [configuration](https://torsion.org/borgmatic/docs/reference/configuration/). I think it'll do exactly what you're looking for! Either way, please do let me know. Thanks!
witten added the
question / support
label 2020-08-12 17:12:00 +00:00
Author

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!

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!
hk closed this issue 2020-08-12 18:55:55 +00:00
Owner

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.

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.
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#353
No description provided.