Minecraft: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
(Die Seite wurde neu angelegt: „ == Start == == Backup == screen -x 2823 -X stuff `printf "save-all\r"`“) |
(→Start) |
||
(3 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
Zeile 1: | Zeile 1: | ||
== Start == | |||
=== Runlevel === | |||
screen -dmS minecraft /srv/www/minecraft/start.sh | |||
=== start.sh === | |||
#!/bin/bash | |||
# | |||
# Start Minecraft Server | |||
# | |||
cd /srv/www/minecraft | |||
java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui | |||
# | |||
== Backup == | == Backup == | ||
screen -x | === Eintrag in der crontab === | ||
# Minecraft Server sichern | |||
# | |||
00 */2 * * * root /srv/www/minecraft/save.sh | |||
=== save.sh === | |||
#!/bin/bash | |||
# | |||
# Backup Minecraft Server | |||
# | |||
# Info an alle Benutzer | |||
screen -x minecraft -X stuff "$(printf 'say Datensicherung startet ...\r')" | |||
sleep 1 | |||
# Alles sichern und "offline" gehen | |||
screen -x minecraft -X stuff "$(printf 'save-all\r')" | |||
sleep 5 | |||
screen -x minecraft -X stuff "$(printf 'save-off\r')" | |||
sleep 1 | |||
# | |||
# | |||
# | |||
cd /srv/www/minecraft | |||
FNAME=$(date +"%Y.%m.%d-%H:%M:%S") | |||
7za a -r /srv/hdd/mc-$FNAME * | |||
# wieder Online gehen | |||
screen -x minecraft -X stuff "$(printf 'save-on\r')" | |||
sleep 1 | |||
screen -x minecraft -X stuff "$(printf 'say Datensicherung beendet!\r')" | |||
# |
Aktuelle Version vom 5. Mai 2011, 11:11 Uhr
Start
Runlevel
screen -dmS minecraft /srv/www/minecraft/start.sh
start.sh
#!/bin/bash # # Start Minecraft Server # cd /srv/www/minecraft java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui #
Backup
Eintrag in der crontab
# Minecraft Server sichern # 00 */2 * * * root /srv/www/minecraft/save.sh
save.sh
#!/bin/bash # # Backup Minecraft Server # # Info an alle Benutzer screen -x minecraft -X stuff "$(printf 'say Datensicherung startet ...\r')" sleep 1 # Alles sichern und "offline" gehen screen -x minecraft -X stuff "$(printf 'save-all\r')" sleep 5 screen -x minecraft -X stuff "$(printf 'save-off\r')" sleep 1 # # # cd /srv/www/minecraft FNAME=$(date +"%Y.%m.%d-%H:%M:%S") 7za a -r /srv/hdd/mc-$FNAME * # wieder Online gehen screen -x minecraft -X stuff "$(printf 'save-on\r')" sleep 1 screen -x minecraft -X stuff "$(printf 'say Datensicherung beendet!\r')" #