From 6269fafddadf971fdac202f7adf61097b3e8e286 Mon Sep 17 00:00:00 2001 From: Holger Frey Date: Mon, 12 Aug 2019 12:16:36 +0200 Subject: [PATCH] working on comparing checksums --- compare_checksums.py | 6 +++--- create_snapshot_backup.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compare_checksums.py b/compare_checksums.py index 3a7450c..2ba28f6 100644 --- a/compare_checksums.py +++ b/compare_checksums.py @@ -49,11 +49,11 @@ def get_remote_checksum(local_backup_path): return None def get_local_checksum(local_backup_path): - result = call(["sha256", str(local_backup_path), as_text=True) + result = call(["sha256", str(local_backup_path)], as_text=True) parts = result.split("=") return parts[1].strip() -def batch_check() +def batch_check(): for local_backup_path in get_local_backups(): remote_checksum = get_remote_checksum(local_backup_path) local_checksum = get_local_checksum(local_backup_path) @@ -61,7 +61,7 @@ def batch_check() print("? {local_checksum} -> (error)") elif remote_checksum == local_checksum: print(" {local_checksum} -> {remote_checksum}") - else + else: print("XXX {local_checksum} -> {remote_checksum}") diff --git a/create_snapshot_backup.py b/create_snapshot_backup.py index 7b1f725..11f1406 100755 --- a/create_snapshot_backup.py +++ b/create_snapshot_backup.py @@ -46,7 +46,7 @@ def remote_call(arguments): """ cmd = ["ssh", "-i", SSH_KEY_FILE, SSH_REMOTE] cmd.extend(arguments) - result = subprocess.run(cmd, as_text=True) + return call(cmd, as_text=True) def clean_split(text):