forked from coop-cloud/backup-bot-two
better error handling
This commit is contained in:
parent
37cb51674f
commit
e186813a49
11
backupbot.py
11
backupbot.py
|
@ -150,9 +150,14 @@ def run_commands(commands):
|
|||
|
||||
|
||||
def backup_volumes(backup_paths, apps, dry_run=False):
|
||||
result = restic.backup(backup_paths, dry_run=dry_run, tags=apps)
|
||||
print(result)
|
||||
logging.info(result)
|
||||
try:
|
||||
result = restic.backup(backup_paths, dry_run=dry_run, tags=apps)
|
||||
print(result)
|
||||
logging.info(result)
|
||||
except ResticFailedError as error:
|
||||
logging.error(f"Backup failed for {apps}. Could not Backup these paths: {backup_paths}")
|
||||
logging.error(error)
|
||||
exit(1)
|
||||
|
||||
|
||||
@cli.command()
|
||||
|
|
Loading…
Reference in New Issue