|
@@ -27,7 +27,8 @@ müssen für springm beschreibbar sein
|
|
|
'''
|
|
'''
|
|
|
|
|
|
|
|
# ------------------------------------------- start script variables ---
|
|
# ------------------------------------------- start script variables ---
|
|
|
-remotehost = 'r-hermes'
|
|
|
|
|
|
|
+remotehost = 'hermes'
|
|
|
|
|
+ssh_username = 'root'
|
|
|
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'
|
|
@@ -123,7 +124,8 @@ def write_json():
|
|
|
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):
|
|
def rewrite_snapshots_json(host):
|
|
|
- cmd = [ 'ssh', host, 'bash', '-c', "/usr/local/sbin/restic_json.sh" ]
|
|
|
|
|
|
|
+ cmd = [ 'ssh', f"""{ssh_username}@{host}""", 'bash', '-c', "/usr/local/sbin/restic_json.sh" ]
|
|
|
|
|
+ print(cmd)
|
|
|
s = subprocess.check_output( cmd ).decode('utf-8').strip().split(' ')
|
|
s = subprocess.check_output( cmd ).decode('utf-8').strip().split(' ')
|
|
|
print(" ".join(s))
|
|
print(" ".join(s))
|
|
|
|
|
|
|
@@ -139,7 +141,7 @@ args = parser.parse_args()
|
|
|
|
|
|
|
|
ssh = SSHClient()
|
|
ssh = SSHClient()
|
|
|
ssh.load_system_host_keys()
|
|
ssh.load_system_host_keys()
|
|
|
-ssh.connect(remotehost)
|
|
|
|
|
|
|
+ssh.connect(remotehost, username=ssh_username)
|
|
|
|
|
|
|
|
load_jsonfile()
|
|
load_jsonfile()
|
|
|
update_json()
|
|
update_json()
|