From f877186a57f78e65c78ebcaf11a833dd6db46be4 Mon Sep 17 00:00:00 2001 From: Moritz Date: Tue, 15 Oct 2024 18:04:15 +0200 Subject: [PATCH] list restore commands before executing it --- backupbot.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backupbot.py b/backupbot.py index 78c0778..369138f 100755 --- a/backupbot.py +++ b/backupbot.py @@ -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}")