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:
|
try:
|
||||||
logger.info("Start volume backup")
|
logger.info("Start volume backup")
|
||||||
logger.debug(backup_paths)
|
logger.debug(backup_paths)
|
||||||
|
backup_paths = list(filter(path_exists, backup_paths))
|
||||||
result = restic.backup(backup_paths, dry_run=dry_run, tags=apps)
|
result = restic.backup(backup_paths, dry_run=dry_run, tags=apps)
|
||||||
logger.summary("backup finished", extra=result)
|
logger.summary("backup finished", extra=result)
|
||||||
return
|
return
|
||||||
@ -293,6 +294,11 @@ def backup_volumes(backup_paths, apps, retries, dry_run=False):
|
|||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
def path_exists(path):
|
||||||
|
if not path.exists():
|
||||||
|
logger.error(f'{path} does not exist')
|
||||||
|
return path.exists()
|
||||||
|
|
||||||
@cli.command()
|
@cli.command()
|
||||||
@click.option('snapshot', '--snapshot', '-s', envvar='SNAPSHOT', default='latest')
|
@click.option('snapshot', '--snapshot', '-s', envvar='SNAPSHOT', default='latest')
|
||||||
@click.option('target', '--target', '-t', envvar='TARGET', default='/')
|
@click.option('target', '--target', '-t', envvar='TARGET', default='/')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user