add backup function

This commit is contained in:
Aaron Riedel 2022-08-26 16:29:39 +02:00
parent 3958d4b5b3
commit 7c4f382e19
Signed by: aaron
GPG key ID: 643004654D40D577

View file

@ -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)