]> us-delaporte.pagekite.me Git - dotfiles.git/blobdiff - invoke/luanti/tasks.py
Tablet tasks start
[dotfiles.git] / invoke / luanti / tasks.py
index 3c39102c6a6dbddc513d08ecc72f447373f92aef..14636ade9598e16fa3eb51242407d1cb20e5349f 100644 (file)
@@ -9,6 +9,8 @@ root = f"{flat_pak_root}/.minetest"
 mod_dir = f"{root}/mods"
 easy_dir = f"{home}/minetest/"
 run_mt = f"flatpak run net.minetest.Minetest"
+world_dir = f"{root}/worlds"
+scripts = f"{home}/ansible/luanti"
 
 # flatpak
 link_to = f"{home}/.var/app/net.minetest.Minetest/.minetest"  
@@ -132,4 +134,17 @@ def logs(c, lines=20):
     '''Output some logs'''
     c.run(f"tail -n {lines} {root}/debug.txt")
 
+@task
+def backup(c):
+    stopped = input("Is the server stopped?")
+    if(stopped != 'y'):
+        print("so go stop the server...")
+        exit()
+    print("okay...backing up.")
+    c.run(f"{scripts}/do_luanti.sh {scripts}/backup.sh")
+    c.run(f"{scripts}/check_db.sh")
+
+@task
+def checkdb(c):
+    c.run(f"{scripts}/check_db.sh")