Last active
January 22, 2019 00:47
-
-
Save LevitatingBusinessMan/187c88a018fbab0011700862c5cb9daf to your computer and use it in GitHub Desktop.
Minecraft server startup script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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