www.boul.de
Minecraft - Druckversion

+- www.boul.de (https://www.boul.de)
+-- Forum: Hausmeister (https://www.boul.de/forumdisplay.php?fid=10)
+--- Forum: Spiel-"Zeug" (https://www.boul.de/forumdisplay.php?fid=26)
+--- Thema: Minecraft (/showthread.php?tid=220)



Minecraft - Fnups - 29.05.2016

Server-Batch (Win)
* benötigt 7zip (7z.exe)

1) Server starten
2) neue Server.Jar downloaden und reinkopieren
3) im Spiel "stop"
- Server stoppt
- ein Backup der Welt wird angelegt, inkl. Datum & Stunde
- alter Server wird in Minecraft_Server.old umbenannt/gesichert
- neue minecraft_server.16w15b.jar wird passend umbenannt
- Server wird neu gestartet

Code:
@echo off & setlocal
:: wbuname = World Back Up Name
if exist eula.txt goto restart

echo #By changing the setting below to TRUE you are indicating your agreement to our EULA (https://account.mojang.com/documents/minecraft_eula).>eula.txt
echo #Thu Jan 15 06:55:15 CET 2015>>eula.txt
echo eula=true>>eula.txt

:restart
echo.
title Minecraft
set wbuname=
java -Xms1024M -Xmx2048M -jar minecraft_server.jar nogui

if exist minecraft_server.*.jar goto update

cls
echo [x         ] 10%%
title :  9
::ping 127.0.0.1 >nul
cls
echo [xx        ] 20%%
title :  8
::ping 127.0.0.1 >nul
cls
echo [xxx       ] 33%%
title :  7
ping 127.0.0.1 >nul
cls
echo [xxxx      ] 40%%
title :  6
::ping 127.0.0.1 >nul
cls
echo [xxxxx     ] 50%%
title :  5
::ping 127.0.0.1 >nul
cls
echo [xxxxxx    ] 66%%
title :  4
ping 127.0.0.1 >nul
cls
echo [xxxxxxx   ] 70%%
title :  3
::ping 127.0.0.1 >nul
cls
echo [xxxxxxxx  ] 80%%
title :  2
::ping 127.0.0.1 >nul
cls
echo [xxxxxxxxx ] 90%%
title :  1
::ping 127.0.0.1 >nul
cls
echo [xxxxxxxxxx] 100%%
title --RESTART--
ping 127.0.0.1 >nul
cls
goto restart

:update
echo.
echo backup world...
set hour=%time:~-11,2%
setlocal enabledelayedexpansion
set hour=!hour:^ =0!
setlocal disabledelayedexpansion
set wbuname=world_%date:~6,4%-%date:~3,2%-%date:~0,2%_%hour%
if exist %wbuname%.7z del %wbuname%.7z
7z.exe a %wbuname% -w .\world\* -t7z >NUL

echo updating server...
ren %wbuname%.7z %wbuname%_b4update.7z
ren minecraft_server.*.jar x.jar
if exist minecraft_server.old del minecraft_server.old
ren minecraft_server.jar minecraft_server.old
ren x.jar minecraft_server.jar
echo.
goto restart

:schedule
if not exist 2backup md 2backup
if exist 2backup\world del 2backup\world /s

::save-off
::say [System] starte Backup...
copy .\world\*.* .\2backup\*.*
::save-all
::say [System] Backup beendet.

echo.
echo backup world...
set hour=%time:~-11,2%
setlocal enabledelayedexpansion
set hour=!hour:^ =0!
setlocal disabledelayedexpansion
set wbuname=world_%date:~6,4%-%date:~3,2%-%date:~0,2%_%hour%
if exist %wbuname%.7z del %wbuname%.7z
7z.exe a %wbuname% -w .\2backup\world\* -t7z >NUL