diff --git a/backupbot.py b/backupbot.py index a049175..22362d4 100755 --- a/backupbot.py +++ b/backupbot.py @@ -280,6 +280,7 @@ def backup_volumes(backup_paths, apps, retries, dry_run=False): try: logger.info("Start volume backup") logger.debug(backup_paths) + backup_paths = list(filter(path_exists, backup_paths)) result = restic.backup(backup_paths, dry_run=dry_run, tags=apps) logger.summary("backup finished", extra=result) return @@ -293,6 +294,11 @@ def backup_volumes(backup_paths, apps, retries, dry_run=False): exit(1) +def path_exists(path): + if not path.exists(): + logger.error(f'{path} does not exist') + return path.exists() + @cli.command() @click.option('snapshot', '--snapshot', '-s', envvar='SNAPSHOT', default='latest') @click.option('target', '--target', '-t', envvar='TARGET', default='/')