check backup path existence
This commit is contained in:
parent
fe35f1ede8
commit
197cabf564
@ -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='/')
|
||||
|
Loading…
x
Reference in New Issue
Block a user