help with config files #1080
Labels
No labels
blocked
breaking
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#1080
Loading…
Reference in a new issue
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?
Hi
I have been converting my configs files to use borgmatic v2 settings, have also split the config files into common.yaml and <repo_name>.yaml as most are the same settings
I used to have the remote repo files as one (borgbase and rsync.net), until I had to have a different remote_path for rsync.net
I now have the following config files, each for a separate repository. Each use common.yaml to share settings :
Its working well, I now run two config files at the same time (and plan to run three when I use usb), except that before_everything (which is in the common.yaml config file) runs multiple times at the start (seem like one per config file)
Is there anything I can do as I only need to run before_everything once for my usage, even if I have two or three config files in the command line. Its exactly the same as its shared in common.yaml. It calculates checksums of the files to backup, which takes 15-20m each time it runs. Is there another hook I can use instead of it?
Thanks,
Rob
before_everythingcommands should only run once regardless of the number of configuration files, so if that's not the case, there might be a bug. My guess is what's happening is that because you've gotbefore_everythingin your common configuration file, it's in effect getting included and therefore duplicated multiple times. You can validate this theory by running something like the following:This will spit out the config file contents after all the includes and merging and normalization have occurred, and it'll show you whether your
before_everythinggets transformed intocommands:and duplicated there.If it is getting duplicated, then borgmatic might have to somehow get a little smarter about merging duplicate values.
My mistake, when I converted the config files to borgmatic v2 settings, I used
borgmatic config generate --source input.yaml -d output.yaml, before_everything got converted toIts this that is in the common.yaml in place of before_everything. This looks like its the same hook, just a new way to configure it.
When I ran
borgmatic config validate --show --config borgbase.yaml --config rsyncnet.yamlI found that this new
before: everythingcommand got duplicated. There are twocommands:in total (I'm assuming one per config file) and its in both of them, with other commandsI tried by removing
before: everythingfrom common.yaml and put it into borgbase.yaml and rsyncnet.yaml I got the same result.Okay, thanks for verifying. I'll have to think about what if anything I can do about this on the borgmatic side. Maybe transparently deduplicating
everythingcommand hooks as they're collected from multiple configuration files.That would be great.
Just for a test (to cover bases, so to speak), I did try merging borgbase.yaml and common.yaml, also rsyncnet.yaml and common.yaml into two independent config file. I had the same result.
Okay, deduplication of
everythingcommand hooks across configuration files is now implemented in main and will be part of the next release. Thanks for filing this!Released in borgmatic 2.0.4!
That's fantastic. I just tried it and it works great.
Glad to hear it!