You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
489 B
19 lines
489 B
#!/usr/bin/env python3 |
|
import time |
|
import sys |
|
from mcrcon import MCRcon |
|
from CONFIG import HOST,PW,PORT |
|
|
|
flushed=False |
|
with MCRcon(HOST, PW, port=PORT) as mcr: |
|
resp = mcr.command("say BACKUP STARTED") |
|
resp = mcr.command("save-off") |
|
resp = mcr.command("save-all flush") |
|
if "Saved the game" in resp: |
|
flushed=True |
|
print("Flushed map successfully. Don't forget to run enable_autosave.py after the map backup") |
|
|
|
if flushed: |
|
sys.exit(0) |
|
else: |
|
sys.exit(1)
|
|
|