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/remote"
# flatpak
link_to = f"{home}/.var/app/net.minetest.Minetest/.minetest"
print("To run: flatpak run net.minetest.Minetest")
@task
-def restore(c, dir):
+def restore_remote(c, dir):
if not os.path.isdir(dir):
print(f"No backups found at {dir}")
return
c.run(f"mv {dir}/* {world_folder}")
print("Finished")
-# DONT - flatpak hates symlinks
-def link(c):
- # c.run(f"ls -al {link_to}")
- if os.path.isdir(link_to):
- print("Moving existing files...")
- c.run(f"mv {link_to} {easy_dir}")
- if not os.path.isdir(easy_dir):
- raise ValueError(f"{easy_dir} not found.")
- if os.path.exists(link_to):
- print(f"Doing nothing. {link_to} exists.")
- if os.path.isdir(easy_dir) and not os.path.exists(link_to):
- print("Linking...")
- c.run(f"ln -s {easy_dir} {link_to}")
- # c.run(f"ls -al {link_to}")
@task
def status(c):
'''Output some logs'''
c.run(f"tail -n {lines} {root}/debug.txt")
+@task
+def backup_remote(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")
+
+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")