Jump to content
  • 0

BEC autorestarts not working properly, think its a bad command in my scheduler


colklutz88

Question

I have previously ran a server, but BEC has updated a few times since the last time I ran one, just hoping someone here can look over my scheduler.xml and shed some light on where my commands are wrong.  BEC properly schedules all 14 tasks, however, when the server comes due for a restart, it kills the server without starting it again.  I created a server_restart.bat, and it works properly, tested it a few times manually.  It kills the server and BEC then waits 10 seconds, starts the server, waits another 10 seconds, and starts BEC.  So I am pretty sure the issue is not with my batch file.  I have the scheduler configured like this at the moment, feel free to take it for your own if you know how to fix it.  I tried calling a command to execute my restart.bat, but BEC continues to say that it is a bad command, so I tried the #shutdown command, with another task afterwards to execute the server launcher.bat, and that fails to actually start the server, let alone, it won't actually start BEC again either, since BEC closes when the server shuts down.

 

This is my current scheduler.xml, any help would be appreciated at getting my restart.bat to work properly.

 

http://pastebin.com/BqaVCRUG

 

I just took the scheduler that came with BEC and edited it to serve my needs, hence why some of the original commented lines are still there for a tutorial of what the tasks originally did before I repurposed them.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

I personally use two autorestarters. One that restarts my server, and one that restarts BEC. The problem I ran into with having BEC restart my server, was BEC would autoclose as soon as the server stopped. So, it wouldn't complete the scheduler, meaning it wouldn't get to the last line of it in order to restart the server.

 

Having two .bat also means that if BEC has a problem and closes, it will start back up again on its own, and not leave your server running 24/7 with no restarts. If your server crashes, it will get restarted as well. In case #2, BEC would have auto closed, and then restarted again also.

 

Having them both in the same restarter, obviously works for many people I am sure, but in my head I see either BEC or the server crashing, and then they don't get restarted because of the /wait on the one that is still running.

 

Of course, your question sounds like it could possibly of been what was happening to me, and I just need to make sure I had the correct capitalization for my files. Who knows. But, using the two restarters is how I solved it. Also, thinking about it more, with both in one file, server first then bec, if the server closed, bec would close on its own anyway, then the file would start them both again, unless bec doesn't wait long enough for the server to start if for some reason the server takes longer than normal, in which case bec would close and not be restarted until the server restarts, which could be never. But, of course there is only one /wait I suppose, so my logic is flawed some where anyway I am sure :)

 

My server restarter also rotates my logs, instead of doing it separately. Makes it so the old files can be deleted at the same time they are moved.

Link to comment
Share on other sites

  • 0

My server restarter incase some one wants one with rotate also.

@echo off
color 0a
title Start/Rotate Server 2302
:top
echo Preparing to Launch!
ping 127.0.0.1 -n 3 >NUL
cls
 
echo Launching And Watching Server 2302
start /wait C:\1Dayz_Server\arma2oaserver.exe -port=2302 "-config=C:\1Dayz_Server\instance_24_Napf\config.cfg" "-cfg=C:\1Dayz_Server\instance_24_Napf\basic.cfg" "-profiles=instance_24_Napf" -name=instance_24_Napf "-mod=@DayZ_Epoch_Server;@DayzOverwatch;@DayZ_Epoch;" -bepath=C:\1Dayz_Server\instance_24_Napf\BattlEye -maxMem=2096
ping 127.0.0.1 -n 3 >NUL
echo Server has exited ... Rotating Logs and Restarting!
ping 127.0.0.1 -n 3 >NUL
cls
 
:::::::::::::: CONFIG ::::::::::::::::::
:: Set your Arma2AO Base installation directory. LEAVE OFF THE ENDING \
set arma2srvpath=C:\1Dayz_Server
:: Set your Default server profile name. This is the name of the directory that stores your server.cfg
:: This will be used in the case that you don't launch this script without the server param.
:: Example: cfgdayz, US6, Chicago13, ect
:: DEFAULTPROFILE
set srvname=instance_24_napf
:: If server is stopped, delete Original log files after they have been rotated?
set deloriglogs=1
::::::::::: ADVANCED CONFIG ::::::::::::
:: Setting Server Profile to Use
IF "%1"=="" (
set servername=%srvname%
) else (
set servername=%1
)
 
TITLE  DayZ %servername% Server Log Rotater
 
:: Set Debug Mode
set debug=0
:: Set Debug Timeout in seconds
set dbsecs=10
 
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::  STOP EDITING ::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 
:: Display Debug output
if %debug% == 1 (
echo Server Name = %servername%
echo ArmaII Server Path = "%arma2srvpath%"
timeout %dbsecs%
)
 
:: Set Time and Date
SET HOUR=%time:~0,2%
SET dtStamp9=%date:~-4%%date:~4,2%%date:~7,2%_0%time:~1,1%%time:~3,2%_%time:~6,2%
SET dtStamp24=%date:~-4%%date:~4,2%%date:~7,2%_%time:~0,2%%time:~3,2%_%time:~6,2%
::Make Date Stamp
if "%HOUR:~0,1%" == " " (SET dtStamp=%dtStamp9%) else (SET dtStamp=%dtStamp24%)
ECHO Todays Date and time (%date%)(%time%) / %dtStamp%
if %debug% == 1 (
timeout %dbsecs%
)
 
echo (%date%) (%time%) Starting Log Rotation.
 
:: Make the Rotated Log Directories
if exist "%arma2srvpath%\%servername%\RotatedLogs" goto maketsdir
mkdir "%arma2srvpath%\%servername%\RotatedLogs"
:maketsdir
if exist "%arma2srvpath%\%servername%\RotatedLogs\%dtStamp%" goto makebedir
mkdir "%arma2srvpath%\%servername%\RotatedLogs\%dtStamp%"
:makebedir
if exist "%arma2srvpath%\%servername%\RotatedLogs\%dtStamp%\BattlEye" goto rotatelogs
mkdir "%arma2srvpath%\%servername%\RotatedLogs\%dtStamp%\BattlEye"
 
:rotatelogs
:: Starting Log Rotation. If there are any other logs, just follow the format below, and make sure to NOT touch any of the varibles.
copy "%arma2srvpath%\%servername%\arma2oaserver.RPT" "%arma2srvpath%\%servername%\RotatedLogs\%dtStamp%\arma2oaserver.RPT"
copy "%arma2srvpath%\%servername%\arma2oaserver.mdmp" "%arma2srvpath%\%servername%\RotatedLogs\%dtStamp%\arma2oaserver.mdmp"
copy "%arma2srvpath%\%servername%\arma2oaserver.bidmp" "%arma2srvpath%\%servername%\RotatedLogs\%dtStamp%\arma2oaserver.bidmp"
copy "%arma2srvpath%\%servername%\server_log.txt" "%arma2srvpath%\%servername%\RotatedLogs\%dtStamp%\server_log.txt"
copy "%arma2srvpath%\%servername%\HiveExt.log" "%arma2srvpath%\%servername%\RotatedLogs\%dtStamp%\HiveExt.log"
copy "%arma2srvpath%\%servername%\napf_Server_log.txt" "%arma2srvpath%\%servername%\RotatedLogs\%dtStamp%\napf_Server_log.txt"
copy "%arma2srvpath%\%servername%\BattlEye\scripts.log" "%arma2srvpath%\%servername%\RotatedLogs\%dtStamp%\BattlEye\scripts.log"
copy "%arma2srvpath%\%servername%\BattlEye\createvehicle.log" "%arma2srvpath%\%servername%\RotatedLogs\%dtStamp%\BattlEye\createvehicle.log"
copy "%arma2srvpath%\%servername%\BattlEye\mpeventhandler.log" "%arma2srvpath%\%servername%\RotatedLogs\%dtStamp%\BattlEye\mpeventhandler.log"
copy "%arma2srvpath%\%servername%\BattlEye\publicvariable.log" "%arma2srvpath%\%servername%\RotatedLogs\%dtStamp%\BattlEye\publicvariable.log"
copy "%arma2srvpath%\%servername%\BattlEye\publicvariableval.log" "%arma2srvpath%\%servername%\RotatedLogs\%dtStamp%\BattlEye\publicvariableval.log"
copy "%arma2srvpath%\%servername%\BattlEye\remoteexec.log" "%arma2srvpath%\%servername%\RotatedLogs\%dtStamp%\BattlEye\remoteexec.log"
copy "%arma2srvpath%\%servername%\BattlEye\setdamage.log" "%arma2srvpath%\%servername%\RotatedLogs\%dtStamp%\BattlEye\setdamage.log"
copy "%arma2srvpath%\%servername%\BattlEye\setpos.log" "%arma2srvpath%\%servername%\RotatedLogs\%dtStamp%\BattlEye\setpos.log"
copy "%arma2srvpath%\%servername%\BattlEye\setvariable.log" "%arma2srvpath%\%servername%\RotatedLogs\%dtStamp%\BattlEye\setvariable.log"
copy "%arma2srvpath%\%servername%\BattlEye\addmagazinecargo.log" "%arma2srvpath%\%servername%\RotatedLogs\%dtStamp%\BattlEye\addmagazinecargo.log"
 
echo (%date%) (%time%) Logs are backed up now...
echo (%date%) (%time%) Removing original log files.
del /Q /F "%arma2srvpath%\%servername%\arma2oaserver.RPT"
del /Q /F "%arma2srvpath%\%servername%\arma2oaserver.mdmp"
del /Q /F "%arma2srvpath%\%servername%\arma2oaserver.bidmp"
del /Q /F "%arma2srvpath%\%servername%\server_console.log"
del /Q /F "%arma2srvpath%\%servername%\runtime.log"
del /Q /F "%arma2srvpath%\%servername%\BattlEye\scripts.log"
del /Q /F "%arma2srvpath%\%servername%\BattlEye\createvehicle.log"
del /Q /F "%arma2srvpath%\%servername%\BattlEye\mpeventhandler.log"
del /Q /F "%arma2srvpath%\%servername%\BattlEye\publicvariable.log"
del /Q /F "%arma2srvpath%\%servername%\BattlEye\publicvariableval.log"
del /Q /F "%arma2srvpath%\%servername%\BattlEye\remoteexec.log"
del /Q /F "%arma2srvpath%\%servername%\BattlEye\setdamage.log"
del /Q /F "%arma2srvpath%\%servername%\BattlEye\setpos.log"
del /Q /F "%arma2srvpath%\%servername%\BattlEye\setvariable.log"
del /Q /F "%arma2srvpath%\%servername%\BattlEye\addmagazinecargo.log"
 
if %debug% == 1 (
timeout %dbsecs%
)
 
:: We're done here, restart server.
goto top

Link to comment
Share on other sites

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
  • Advertisement
  • Discord

×
×
  • Create New...