Created
February 13, 2013 09:34
-
-
Save withgod/4943337 to your computer and use it in GitHub Desktop.
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/sh | |
if [ -f /mnt/ramdisk/world.ramdisk/level.dat ]; then | |
/home/withgod/bin/mc_save-off.sh | |
if [ $? == 1 ]; then | |
echo "save-off error $?" | |
exit; | |
fi | |
rsync -a --delete /mnt/ramdisk/world.ramdisk /media/hdb/game_server/minecraft_maps/ | |
/home/withgod/bin/mc_save-on.sh | |
else | |
echo 'not mount world.ramdisk' | |
exit 2; | |
fi |
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/sh | |
function _exec { | |
screen -S minecraft -X eval "$1" | |
screen -S minecraft -X eval "stuff ^M" | |
#screen -S minecraft -X eval "stuff ^M" | |
} | |
_exec "stuff 'save-off'"; |
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/sh | |
function _exec { | |
screen -S minecraft -X eval "$1" | |
screen -S minecraft -X eval "stuff ^M" | |
#screen -S minecraft -X eval "stuff ^M" | |
} | |
_exec "stuff 'save-on'"; |
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/sh | |
if [ ! -d /mnt/ramdisk/world.ramdisk ]; then | |
cp -r /media/hdb/game_server/minecraft_maps/world.ramdisk /mnt/ramdisk | |
fi | |
cd /media/hdb/game_server/minecraft_bukkit | |
screen -AmdS minecraft java -Xms1024M -Xmx2048M -jar craftbukkit-0.0.1-SNAPSHOT.jar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
run.shで起動時に hdd から tmpfs にファイルをコピーしてから起動
しておくこと(こうすることで world だけ tmpfs で扱いやすい(実体がtmpfsにあればそこを参照出来る))
backup.sh を crontab に設定、短い方が良いと言えば良いんだけど、あまり短すぎるとio発生しまくりなので俺の場合は10分間隔にしてた(一応rsyncで差分バックアップだし)
backup.sh でバックアップ取る前に save off して書き込み停止してからrsyncして save on して終了してるので不整合は起きないはず