From 7c4f382e1997b8864557eef7b33a96dd5953c87f Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Fri, 26 Aug 2022 16:29:39 +0200 Subject: [PATCH] add backup function --- shcloud.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shcloud.py b/shcloud.py index 246d2e0..5499c72 100755 --- a/shcloud.py +++ b/shcloud.py @@ -49,6 +49,10 @@ def delete_server(s): task_stop_game = progress.add_task("[red]Stop Game", total=None) subprocess.check_output("ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null shcloud.eu 'su -c \"cd /gameserver/%s && /gameserver/%s/%s stop\" gameserver'"%(server_game, server_game, server_game), shell=True,stderr=subprocess.STDOUT) progress.update(task_stop_game, completed=1, total=1) + # backup game files + task_backup = progress.add_task("[red]Backup files", total=None) + subprocess.check_output("scp shcloud.eu:/gameserver/home/gameserver/.config/Epic/FactoryGame/Saved/SaveGames/server/* /root/backup/sfserver/", shell=True,stderr=subprocess.STDOUT) + progress.update(task_backup, completed=1, total=1) response = s.shutdown() track_progress(response.id, response.command) response = client.volumes.detach(volume)