From 47babb6080f7f0268cbb24d49f51b894dfb8cedf Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 3 Mar 2025 15:14:49 +0100 Subject: [PATCH] lala --- omv_backup_v3.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/omv_backup_v3.py b/omv_backup_v3.py index 9466b6a..3b15401 100644 --- a/omv_backup_v3.py +++ b/omv_backup_v3.py @@ -311,6 +311,12 @@ if _RESTORE: cmnd = f"rsync -avz --delete {BACKUP_HOST}:{BACKUP_DEVICE}{NEW_BACKUP_DIR} {SOURCE_DIR}" ans = "y" print(cmnd) + + if _TEST: + ans = input("continue?") or "n" + if ans == "y" and _EXECUTE: + status, output = subprocess.getstatusoutput(cmnd) + file = "/share/docker_data/homepage/config/widgets.yaml" with open(file, 'r') as stream: try: @@ -325,17 +331,15 @@ if _RESTORE: # Save it again print(f"writing to file {file}") - with open("/tmp/lala", 'w') as stream: + with open(file, 'w') as stream: try: yaml.dump(loaded, stream, default_flow_style=False) except yaml.YAMLError as exc: print("failed") print(exc) - - if _TEST: - ans = input("continue?") or "n" - if ans == "y" and _EXECUTE: - status, output = subprocess.getstatusoutput(cmnd) + + + print("Start docker") # cmnd = "docker start heimdall" # status, output = subprocess.getstatusoutput(cmnd)