Holger Frey
5 years ago
1 changed files with 33 additions and 0 deletions
@ -0,0 +1,33 @@
@@ -0,0 +1,33 @@
|
||||
#!/usr/local/bin/python |
||||
|
||||
import pathlib |
||||
import subprocess |
||||
|
||||
from copy_snapshots_to_remote import get_member_name |
||||
from create_snapshot_backup import call, remote_call |
||||
|
||||
SSH_KEY_FILE = "/mnt/Datenspeicher/snap-backup-dataset/backup_key" |
||||
SSH_REMOTE = "zfs_snap_backup@etha.cpi.imtek.uni-freiburg.de" |
||||
|
||||
REMOTE_PATH = "zfs-backups" |
||||
|
||||
ZFS_POOL = "Datenspeicher" |
||||
ZFS_ELAB_PREFIX = "elabfs-" |
||||
|
||||
TMP_BACKUP_FOLDER = "/mnt/Datenspeicher/snap-backup-dataset/temporary-backups" |
||||
|
||||
|
||||
|
||||
def get_local_backup_members(): |
||||
tmp_folder = pathlib.Path(TMP_BACKUP_FOLDER) |
||||
backups = (i for i in tmp_folder.iterdir() if i.suffix==".gz") |
||||
return (get_member_name(b) for b in backups) |
||||
|
||||
|
||||
def get_remote_checksums(): |
||||
result = {} |
||||
for member in get_local_backup_members(): |
||||
remote_path = f"{REMOTE_PATH}/{member}" |
||||
cmd_result = remote_call(["sha256sum", remote_path]) |
||||
print(cmd_result) |
||||
|
Loading…
Reference in new issue