Sign in to follow this  
Followers 0
Hatler

bat file check and restart

2 posts in this topic

MOIN MOIN,

 

ich probiere es mal auf deutsch ^^ vllt könnte mir jemand helfen.....

Es handelt sich um den prozesscheck und um einen automatischen restart.

 

 

ich habe hier auf dem board ein restartskript gefunden was eigentlich super funktioniert...

 

problem. Server startet 1. nicht nach angegebener zeit und 2. erkennt er die uhrzeit nicht woraus sich meinermeinung nach 1. ergibt ^^

 

Ich wäre euch für jede hilfe dankbar

 

ich führe die .bat nicht mit powershell aus den da hab ich das problem das er die angegebene exe nicht findet. wird ganz normal mit CMD ausgeführt und da gibt es keine Uhrzeitausgabe..

 

es geht um diesen POST !  -->  http://www.exilemod.com/topic/7565-my-arma-exile-auto-restart-process-checker/#comment-52804

 

The Batch File (save as auto_restart.bat or anothername.bat)

@echo off
cls

set gameserver=Arma Exile

title %gameserver% Auto Restart / Process Checker

:start


REM How long until auto restart?
set hours="4"
set minutes="0"
set seconds="0"

REM // Launch parameters
start "Exile" /high "arma3server.exe" -port=2302 "-config=@ExileServer\config.cfg" "-cfg=@ExileServer\basic.cfg" "-profiles=config_exile" -name=Exile "-servermod=@ExileServer;" "-mod=@Exile;" -malloc=tbbmalloc -autoinit -enableHT


REM //////// You do not need to update anything else below this line ////////


REM Pull, display and create some time functions
for /f "delims=" %%G IN ('powershell "(get-date %time%).AddHours(%hours%).AddMinutes(%minutes%).AddSeconds(%seconds%).ToString('yyyyMMddHHmmss')"') do set endtime=%%G
for /f "delims=" %%G IN ('powershell "(get-date %time%).ToString('HH:mm:ss')"') do set nowtimeclean=%%G
for /f "delims=" %%G IN ('powershell "(get-date %time%).AddHours(%hours%).AddMinutes(%minutes%).AddSeconds(%seconds%).ToString('HH:mm:ss')"') do set endtimeclean=%%G

echo %time% - %gameserver% Server started at %nowtimeclean% and will restart at %endtimeclean%

:checkarma

for /f "delims=" %%G IN ('powershell "(get-date %time%).ToString('yyyyMMddHHmmss')"') do set nowtime=%%G

REM ////////// TIMER CHECK ///////////
if "%nowtime%" gtr "%endtime%" (
echo %time% - It is time to restart %gameserver%!
echo.
echo.
goto restartarma
)
REM ////////// END TIMER CHECK ///////////

REM ////////// PROCESS CHECK ///////////
tasklist /FI "IMAGENAME eq arma3server.exe" 2>NUL | find /I /N "arma3server.exe">NUL
if "%ERRORLEVEL%"=="1" (
echo %time% - The process is not running, restart %gameserver%!
echo.
echo.
goto restartarma
)
REM ////////// END PROCESS CHECK ///////////


REM restart not needed. Check again in 3 seconds.
TIMEOUT /T 3 /NOBREAK >NUL
goto checkarma


:restartarma
REM Either the server crashed or it is time for a restart. Kill the process and go to start.
START taskkill /f /im arma3server.exe 2>nul
TIMEOUT /T 3 /NOBREAK >NUL
goto start

Share this post


Link to post
Share on other sites

Hallo . Kannst gerne in meinem ts kommen kann dir einen Server Monitor .bat geben und was du noch brauchst schau unter tko-gameserver.de 

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.