check backup path existence

This commit is contained in:
Moritz 2024-09-17 13:39:45 +02:00
parent fe35f1ede8
commit 197cabf564

View File

@ -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='/')