Browse Source

working on comparing checksums

master
Holger Frey 5 years ago
parent
commit
a670c3b881
  1. 5
      compare_checksums.py

5
compare_checksums.py

@ -45,7 +45,6 @@ def get_remote_checksum(local_backup_path):
parts = result.strip().split() parts = result.strip().split()
return parts[0].strip() return parts[0].strip()
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
print(f"ERROR: {remote_path} -> {e.stderr}")
return None return None
def get_local_checksum(local_backup_path): def get_local_checksum(local_backup_path):
@ -57,9 +56,7 @@ def batch_check():
for local_backup_path in get_local_backups(): for local_backup_path in get_local_backups():
remote_checksum = get_remote_checksum(local_backup_path) remote_checksum = get_remote_checksum(local_backup_path)
local_checksum = get_local_checksum(local_backup_path) local_checksum = get_local_checksum(local_backup_path)
if remote_checksum is None: if remote_checksum == local_checksum:
print(f"? {local_checksum} -> (error)")
elif remote_checksum == local_checksum:
print(f" {local_checksum} -> {remote_checksum}") print(f" {local_checksum} -> {remote_checksum}")
else: else:
print(f"XXX {local_checksum} -> {remote_checksum}") print(f"XXX {local_checksum} -> {remote_checksum}")

Loading…
Cancel
Save