MINECRAFT=f'{HOME}/Minecraft'
-dims = ['world', 'world_nether', 'world_the_end']
+DIRS = ['world', 'world_nether', 'world_the_end', 'plugins']
+
+# TODO: Set these
+JAVA=f'{HOME}/java/jdk21/bin/java'
+JAVA_OPTS=f'-Xms3g -Xmx7g'
+OPTIONS=f'--nogui'
+
+SERVE=f'screen -S Minecraft -d -m {JAVA} {JAVA_OPTS} -jar {MINECRAFT}/server.jar {OPTIONS}'
@task
def compress_world(c):
- for world in dims:
+ for world in DIRS:
c.run(f'{SSH} -C tar cf /tmp/{world}.{DATE_TAR} --directory={MINECRAFT} {world}')
c.run(f'{SSH} -C ls /tmp | grep .tar')
exit()
c.run(f'mkdir -p {LOCAL_BACKUPS}')
- for world in dims:
+ for world in DIRS:
c.run(f'{SCP}:/tmp/{world}.{DATE_TAR} {LOCAL_BACKUPS}')
c.run(f'ls -lh {LOCAL_BACKUPS} | grep .tar')
@task
def verify_backup(c):
- for world in dims:
+ for world in DIRS:
c.run(f'tar tvf {LOCAL_BACKUPS}/{world}.{DATE_TAR} | tail')
c.run(f'tar tvf {LOCAL_BACKUPS}/{world}.{DATE_TAR} | wc')
print(f'Server should now be running in a remote screen session.')
print(result)
+
+@task
+def serve(c):
+ print(f"Attempting to connect to {IP}")
+ result = c.run(f'ssh {USER}@{IP} -C {SERVE}')
+ print(f'Server should now be running in a remote screen session.')
+ print(result)
+