From fd87ddc388f9c6a12f3697254ed5e051f7dcd076 Mon Sep 17 00:00:00 2001 From: Einar Forselv Date: Fri, 6 Dec 2019 08:21:06 +0100 Subject: [PATCH] More logging during backup --- src/restic_compose_backup/cli.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/restic_compose_backup/cli.py b/src/restic_compose_backup/cli.py index 5c9d615..0e7c174 100644 --- a/src/restic_compose_backup/cli.py +++ b/src/restic_compose_backup/cli.py @@ -150,6 +150,7 @@ def start_backup_process(config, containers): errors = True # back up databases + logger.info('Backing up databases') for container in containers.containers_for_backup(): if container.database_backup_enabled: try: @@ -165,14 +166,18 @@ def start_backup_process(config, containers): errors = True if errors: + logger.error('Exit code: %s', errors) exit(1) # Only run cleanup if backup was successful result = cleanup(config, container) - logger.debug('cleanup exit code: %s', errors) + logger.debug('cleanup exit code: %s', result) if result != 0: + logger.error('Exit code: %s', result) exit(1) + logger.info('Backup completed') + def cleanup(config, containers): """Run forget / prune to minimize storage space"""