Skip to content

Instantly share code, notes, and snippets.

@TheLinx
Created September 21, 2010 16:05
Show Gist options
  • Save TheLinx/589938 to your computer and use it in GitHub Desktop.
Save TheLinx/589938 to your computer and use it in GitHub Desktop.
Note: These are Minecraft server management scripts. They're quite handy.
#!/bin/bash
function print {
screen -S mc -X stuff "$1
"
}
print "say Creating backup..."
print "save-off"
print "save-all"
zip -r /tmp/fpfa.zip /home/thelinx/mc/fpfa/*
mv /tmp/fpfa.zip /var/www/mc/`date "+fpfa-%m%d%H.zip"`
print "say Backup completed!"
print "save-all"
print "save-on"
#!/bin/bash
# 2GB ram because 1GB was not enough ;_;
screen -dmS mc java -Xmx2048M -Xms2048M -jar minecraft_server.jar nogui
echo "Server started."
#!/bin/bash
function print {
screen -S mc -X stuff "$1
"
}
print "say Server shutting down in 5..."
sleep 1
for n in 4 3 2 1; do
print "say $n..."
sleep 1
done
print "stop"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment