fix(restore): don't restore everything if no backup_path is given.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Moritz 2024-10-28 17:24:41 +01:00
parent f1661c04e7
commit 3eea69ddee

View File

@ -155,11 +155,14 @@ def restore(snapshot_id, target, noninteractive, volumes, container, no_commands
if not no_commands and pre_commands:
print(f"Run pre commands.")
run_commands(pre_commands)
result = restic_restore(snapshot_id=snapshot_id, include=backup_paths, target_dir=target)
if backup_paths:
result = restic_restore(snapshot_id=snapshot_id, include=backup_paths, target_dir=target)
logger.debug(result)
else:
print('No paths to restore.')
if not no_commands and post_commands:
print(f"Run post commands.")
run_commands(post_commands)
logger.debug(result)
@cli.command()