Skip to content

Instantly share code, notes, and snippets.

@LevitatingBusinessMan
Last active January 22, 2019 00:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LevitatingBusinessMan/187c88a018fbab0011700862c5cb9daf to your computer and use it in GitHub Desktop.
Save LevitatingBusinessMan/187c88a018fbab0011700862c5cb9daf to your computer and use it in GitHub Desktop.
Minecraft server startup script
#!/bin/bash
#Has to be run from within server files
#(because of how the server itself works)
if pgrep -x "world_backup.sh" > /dev/null
then
echo "Backup script already running"
else
echo "Starting backup script"
world_backup.sh &
fi
while true
do
echo Starting server...
java -Xms1G -Xmx2G -jar paperclip-504.jar
echo Restarting in 5 seconds...
sleep 5
done
#!/bin/bash
WORLD_DIRECTORY=/home/rein/Paper/world
BACKUP_DIRECTORY=${WORLD_DIRECTORY}_backup
while true
do
cp -r ${WORLD_DIRECTORY} ${BACKUP_DIRECTORY}
sleep 300
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment