From 9315717d03ba07a24d093b0a713c13a552b627c7 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Mon, 19 Jun 2023 22:33:29 -0700 Subject: [PATCH] Prevent file listing from showing up twice. --- borgmatic/borg/check.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/borgmatic/borg/check.py b/borgmatic/borg/check.py index 5a512e6e..f19647aa 100644 --- a/borgmatic/borg/check.py +++ b/borgmatic/borg/check.py @@ -349,12 +349,13 @@ def upgrade_check_times(location_config, borg_repository_id): temporary_path = f'{old_path}.temp' logger.debug(f"#713: temporary_path = '{temporary_path}'") - logger.debug(f"\n#713: file listing:") - logger.debug( - execute_command_and_capture_output( - ['ls', '-alR', f'{os.path.dirname(os.path.dirname(old_path))}'], capture_stderr=True, shell=True + if check_type == 'archives': + logger.debug(f"\n#713: file listing:") + logger.debug( + execute_command_and_capture_output( + ['ls', '-alR', f'{os.path.dirname(os.path.dirname(old_path))}'], capture_stderr=True, shell=True + ) ) - ) logger.debug(f"#713: os.path.isfile(old_path) = {os.path.isfile(old_path)}") logger.debug(f"#713: os.path.isfile(temporary_path) = {os.path.isfile(temporary_path)}")