From a3f27fa6bafbf835dd36aefae26868e7da969b40 Mon Sep 17 00:00:00 2001 From: Moritz Date: Wed, 11 Oct 2023 17:46:27 +0200 Subject: [PATCH] log before container command --- backupbot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backupbot.py b/backupbot.py index 2675cd6..96c93c6 100755 --- a/backupbot.py +++ b/backupbot.py @@ -131,9 +131,9 @@ def run_commands(commands): command = command.removeprefix('bash -c \'').removeprefix('sh -c \'') command = command.removesuffix('\'') command = f"bash -c 'set -o pipefail;{command}'" - result = container.exec_run(command) - logging.info(f"run command in {container.name}") + logging.info(f"run command in {container.name}:") logging.info(command) + result = container.exec_run(command) if result.exit_code: logging.error( f"Failed to run command {command} in {container.name}: {result.output.decode()}")