Allow 'borgmatic check' to run orphaned objects check without separate configuration file #779
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#779
Loading…
Reference in New Issue
Block a user
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?
What I'd like to do and why
With borgmatic < version 1.8 it has been possible to check all archives in a repository, which makes "borg" check for orphaned objects. In order to do this, one would have specified
prefix: ""
in config sectionconsistency:
. With the new, flat configuration file format (and the prefix option being deprecated in borg) this is no longer possible.Looking at the documentation, there is the new command line option
--match-archives
. Unfortunately this option is not supported forborgmatic check
, but only for actions "info", "list", "rlist" and "transfer".Next idea has been to use
--override
to overridearchive_name_format
. Unfortunately this doesn't work either:Next try...
And another seemingly clever idea:
I did not test whether it works using an extra configuration file (it probably does, but it kinda misses the point of using borgmatic instead of naked borg).
Afaics there are two possible solutions to this problem:
--match_archives
work forborgmatic check
. Combined with the already implemented #734--match_archives "*"
should allow orphaned objects check--all-archives
) which makes this behavior explicit.Other notes / implementation ideas
No response
Thanks for filing this! There's no good reason why
borgmatic check
shouldn't have a--match-archives
flag like some of the other actions do. Seems like an easy addition.As for your various
--override
attempts, I think what's going on is that the value is (intentionally) getting parsed as JSON.. which unfortunately mean it's not easy to specify a Borg pattern there. So I'll also look into whether there's any way around that without losing the JSON functionality.I added a
--match-archives
flag to thecheck
action in main, and it'll be part of the next release!(Side note: Your ISP is currently bouncing notification emails from this server, so you may not be notified of this by email.)
And I've fixed the override issue in main as well. So now if an
--override
is for an option with a string type, borgmatic won't try to parse those values as JSON/YAML and will just leave it as a plain string.Done! (See comments above. You may not have received some comment notifications due to your ISP blocking them.)
Just released with borgmatic 1.8.5!
From amiconn on IRC:
Re-fixed in main. It looks like Borg decides not to run the orphaned objects check when it receives
--match-archives *
, so I worked around that by not passing through--match-archives
at all when the value is*
or similar.Released in 1.8.10!