list restore commands before executing it

This commit is contained in:
Moritz 2024-10-15 18:04:15 +02:00
parent 9dc239b199
commit f877186a57

View File

@ -129,6 +129,10 @@ def restore(snapshot, target, noninteractive, volumes, container, no_commands):
print("The following volume paths will be restored:")
for p in backup_paths:
print(f'\t{p}')
if not no_commands:
print("The following commands will be executed:")
for container, cmd in list(pre_commands.items()) + list(post_commands.items()):
print(f"\t{container.labels['com.docker.swarm.service.name']}:\t{cmd}")
print(f"This snapshot is {delta} old")
print(
f"THIS COMMAND WILL IRREVERSIBLY OVERWRITES FILES AT {target}")