From 30525c43bf5de2ca63539580a19aacdeb2f4395e Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Tue, 12 Nov 2019 11:24:31 -0800 Subject: [PATCH] Another edge case: Don't error on non-matching restore path globs (#228). --- borgmatic/borg/extract.py | 7 +++++-- borgmatic/commands/borgmatic.py | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/borgmatic/borg/extract.py b/borgmatic/borg/extract.py index f365942..7ed2967 100644 --- a/borgmatic/borg/extract.py +++ b/borgmatic/borg/extract.py @@ -62,6 +62,7 @@ def extract_archive( remote_path=None, destination_path=None, progress=False, + error_on_warnings=True, ): ''' Given a dry-run flag, a local or remote repository path, an archive name, zero or more paths to @@ -90,10 +91,12 @@ def extract_archive( # the terminal directly. if progress: execute_command_without_capture( - full_command, working_directory=destination_path, error_on_warnings=True + full_command, working_directory=destination_path, error_on_warnings=error_on_warnings ) return # Error on warnings, as Borg only gives a warning if the restore paths don't exist in the # archive! - execute_command(full_command, working_directory=destination_path, error_on_warnings=True) + execute_command( + full_command, working_directory=destination_path, error_on_warnings=error_on_warnings + ) diff --git a/borgmatic/commands/borgmatic.py b/borgmatic/commands/borgmatic.py index 8266254..3f6c891 100644 --- a/borgmatic/commands/borgmatic.py +++ b/borgmatic/commands/borgmatic.py @@ -282,6 +282,8 @@ def run_actions( remote_path=remote_path, destination_path='/', progress=arguments['restore'].progress, + # We don't want glob patterns that don't match to error. + error_on_warnings=False, ) # Map the restore names or detected dumps to the corresponding database configurations.