Skip to content

Instantly share code, notes, and snippets.

@KevinKurtz
KevinKurtz / minecraft-sleep.sh
Last active June 19, 2020 00:56 — forked from carchrae/minecraft-sleep.sh
stop (pause) inactive minecraft server process
#!/bin/bash
##I actually use this as part of my run.sh script, so I call minecraft first, but I've commented that out
##I run this in crontab -e as @reboot /home/minecraft/minecraft/run.sh > /dev/null 2>&1
#BINDIR=$(dirname "$(readlink -fn "$0")")
#cd "$BINDIR"
#/usr/bin/screen -d -m -S mcs /usr/bin/java -Xms512M -Xmx1536M -jar server.jar n$
#wait a minute before we start watchdogging the server
#sleep 60
# set this to the port your minecraft server is on