More logging during backup

This commit is contained in:
Einar Forselv 2019-12-06 08:21:06 +01:00
parent 2cbc5aa6fa
commit fd87ddc388
1 changed files with 6 additions and 1 deletions

View File

@ -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"""