Minecraft: Unterschied zwischen den Versionen

Aus OrgaMon Wiki
Zur Navigation springen Zur Suche springen
Keine Bearbeitungszusammenfassung
 
Zeile 1: Zeile 1:
== Start ==
== Start ==
=== Runlevel ===


  screen -dmS minecraft /srv/www/minecraft/start.sh
  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 ==

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')" 

#