Inherit common configuration #381
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#381
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?
What I'm trying to do and why
I have a bunch of different applications to backup, each with slightly different options. But they have many options in common, and I don't want to repeat those options for each application.
I could use the existing include merging feature, but that results in an awkward configuration files where you have to do multiple includes, one per section.
It would be great if there was a more supported way to inherit and reuse common configuration options across the entire configuration file.
Other notes / implementation ideas
One idea is to update the existing include merging feature to do "deep merging". That might look something like this:
/etc/borgmatic/common.yaml
contents:And
/etc/borgmatic.d/myapp.yaml
contents:This would perform a deep merge of all sections including the retention section, such that the resulting interpreted option values would be a
keep_daily
of5
and akeep_hourly
of2
.If you tried this today with a current borgmatic version, the entire
retention
section in/etc/borgmatic.d/myapp.yaml
would replace the entireretention
section from the common file—not what the user wants under this use case.Note that if this deep merging change were made, it would technically be a breaking change to the existing include merging behavior.
Implemented in master! Now you can do this:
... where
common.yaml
is:And it'll do the right thing and produce a
keep_hourly
value of24
and an overriddenkeep_daily
value of5
.Released in borgmatic 1.6.0!