[Question] Does borgmatic check repeat the repo check if I have multiple config files? #558
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#558
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 have a fairly large repo size (~2TB), so my previous consistency check strategy was to disable it in the archive creation runs, then do a separate manual borgmatic check via a weekly crontab.
I have a number of config files in /etc/borgmatic.d, all of which point to the same repository, but different archives. These config files all disable consistency checking. I then have a separate /etc/borgmatic_check.yml that gets used as the config for the check cron job.
I'm trying to simplify my config setup and noticed that at some point borgmatic updated to running the checks no more than once a month, with that interval being customizable.
My question is - if I leave consistency checking on for the config files in /etc/borgmatic.d, is it going to repeat the repo consistency check for every file? Or is it smart enough to only check the repo once?
I'd try it myself to check but doing the repo check once followed by all the archives takes ~8hrs
It's smart enough to only check the repo once, since repository check frequency is performed on a per-repository basis! I just confirmed this by creating two configuration files pointing to the same repo and using the default check frequency of monthly in each. When I ran
borgmatic check
, passing in both configuration files, the check ran for the first configuration file but was skipped for the second.The only caveat is that there's nothing enforcing that every configuration file for a repo has the same check configuration or the same check frequency. So if you set the frequency in one configuration file to monthly and another configuration file to every two weeks, borgmatic will blindly try to make that happen. (The every two weeks one will win, being more frequent.)
Don't know why I didn't think of testing it that way... probably because it was 1:30am :D
Thanks for the quick response!
@witten - Re-opening because I think I broke its "smartness"!
So in my setup, I have a base config file at
/etc/borgmatic.d/common/borgmatic.yml
like:My actual config files in
/etc/borgmatic.d/
all start with<<: !include common/borgmatic.yml
and then overwrite the relevant keys like
source_directories
andhealthchecks
When I run a regular
borgmatic
, it works as expected, executing all operations besides checking. If I runborgmatic --verbosity 2 check --override consistency.checks="[{name: 'repository'}, {name: 'archives'}]"
, though, it runs the repo checks multiple times!I think I can get around this like I did before by specifying
--config /etc/borgmatic.d/common/borgmatic.yml
, but figured I'd mention this here.All of this just to get a separate healthchecks ping for repo checks :)
I'm pretty sure that's because this override doesn't include a frequency for those two checks, and so therefore they're both defaulting to
always
. You can fix that by including a desired frequency in your override. For instance:Let me know if something like that works for you.
This ticket may be of interest to you: #366.
I want it to always run, though. When I run
borgmatic
via cron job #1, it does not run checks, as desired. When I runborgmatic check
with the overrides via cron job #2, it does always run the checks like I want, but it runs the repo checks repeatedly, once for each file in /etc/borgmatic.d. That's what I don't want, since its unnecessary.I worked around it by explicitly specifying a single config file in the command, but I think the default behavior should always be to run repo checks only once regardless of config setup!
Would a short frequency do it? For instance, including a frequency of
2 hours
or so in your override?witten referenced this issue2022-10-03 20:04:17 +00:00
Closing this for now, but feel free to follow up. We can always reopen it. Thanks!
It looks like you may have deleted your most recent comment. Perhaps you figured out the issue? If not, please feel free to let me know. Thanks!
I misread the log files and thought this was still not working as expected. Turns out its something else! So I made a separate issue. Thanks for checking in though. Where do I send my nominations for best FOSS dev? :)
Hah, you're too kind. I'll check out the other ticket!