|
@@ -27,7 +27,7 @@ müssen für springm beschreibbar sein
|
|
|
'''
|
|
'''
|
|
|
|
|
|
|
|
# ------------------------------------------- start script variables ---
|
|
# ------------------------------------------- start script variables ---
|
|
|
-remotehost = 'hermes'
|
|
|
|
|
|
|
+remotehost = 'r-hermes'
|
|
|
remoterepo = '/backupdisk/backupdisk/restic-repo'
|
|
remoterepo = '/backupdisk/backupdisk/restic-repo'
|
|
|
json_remotefile = '/var/lib/restic/backupcopies.json'
|
|
json_remotefile = '/var/lib/restic/backupcopies.json'
|
|
|
json_localfile = '/tmp/backupcopies.json'
|
|
json_localfile = '/tmp/backupcopies.json'
|
|
@@ -122,6 +122,10 @@ def write_json():
|
|
|
except:
|
|
except:
|
|
|
print(f"Error: could not copy {json_localfile} to {remotehost}:{json_remotefile}")
|
|
print(f"Error: could not copy {json_localfile} to {remotehost}:{json_remotefile}")
|
|
|
|
|
|
|
|
|
|
+def rewrite_snapshots_json(host):
|
|
|
|
|
+ cmd = [ 'ssh', host, 'bash', '-c', "/usr/local/sbin/restic_json.sh" ]
|
|
|
|
|
+ s = subprocess.check_output( cmd ).decode('utf-8').strip().split(' ')
|
|
|
|
|
+ print(" ".join(s))
|
|
|
|
|
|
|
|
# ------------------------------------------------------------- main ---
|
|
# ------------------------------------------------------------- main ---
|
|
|
parser = argparse.ArgumentParser(
|
|
parser = argparse.ArgumentParser(
|
|
@@ -141,3 +145,4 @@ load_jsonfile()
|
|
|
update_json()
|
|
update_json()
|
|
|
#print(json.dumps(jso, sort_keys=True, indent=4))
|
|
#print(json.dumps(jso, sort_keys=True, indent=4))
|
|
|
write_json()
|
|
write_json()
|
|
|
|
|
+rewrite_snapshots_json(remotehost)
|