diff --git a/NEWS b/NEWS index d84b3883..bc0f2c29 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,8 @@ catch problems like incorrect excludes, inadvertent deletes, files changed by malware, etc. See the documentation for more information: https://torsion.org/borgmatic/docs/how-to/deal-with-very-large-backups/#spot-check + * #779: When "--match-archives *" is used with "check" action, don't skip Borg's orphaned objects + check. * #842: When a command hook exits with a soft failure, ping the log and finish states for any configured monitoring hooks. * #843: Add documentation link to Loki dashboard for borgmatic: diff --git a/borgmatic/borg/flags.py b/borgmatic/borg/flags.py index c06bcc9a..e6e27978 100644 --- a/borgmatic/borg/flags.py +++ b/borgmatic/borg/flags.py @@ -74,6 +74,9 @@ def make_match_archives_flags(match_archives, archive_name_format, local_borg_ve (like "{now}") with globs. ''' if match_archives: + if match_archives in {'*', 're:.*', 'sh:*'}: + return () + if feature.available(feature.Feature.MATCH_ARCHIVES, local_borg_version): return ('--match-archives', match_archives) else: diff --git a/tests/unit/borg/test_flags.py b/tests/unit/borg/test_flags.py index dde9f7a5..a955148d 100644 --- a/tests/unit/borg/test_flags.py +++ b/tests/unit/borg/test_flags.py @@ -151,6 +151,30 @@ def test_make_repository_archive_flags_with_borg_features_joins_repository_and_a False, ('--glob-archives', '*-docs-{user}'), # noqa: FS003 ), + ( + '*', + '{now}', # noqa: FS003 + True, + (), + ), + ( + '*', + '{now}', # noqa: FS003 + False, + (), + ), + ( + 're:.*', + '{now}', # noqa: FS003 + True, + (), + ), + ( + 'sh:*', + '{now}', # noqa: FS003 + True, + (), + ), ), ) def test_make_match_archives_flags_makes_flags_with_globs(