Skip to content

Commit

Permalink
When "--match-archives *" is used with "check" action, don't skip Bor…
Browse files Browse the repository at this point in the history
…g's orphaned objects check (#779).
  • Loading branch information
witten committed Apr 16, 2024
1 parent 7e51c41 commit b0e49eb
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions borgmatic/borg/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
24 changes: 24 additions & 0 deletions tests/unit/borg/test_flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit b0e49eb

Please sign in to comment.