Jump to content
  • 1

.bat files for dedicated host [Fixed]


Droge Worst

Question

Hey everyone!

 

I'm hosting arma 2 servers since a month or two at Vilayer, but I want to have some more freedom. I've bought a dedi. The servers are running fine on there, but the only thing that is missing is .bat files to restart the server. I'm wondering if there is someone around over here that can help me with those. 

 

What does my .bat file need to do? 

- Shutdown Arma 2 server
- Shutdown bec.

- Repack dayz_server.pbo from a unpacked map (if changed, cause you can't edit the server while running.) 
- Replace my mission file (if changed, cause you can't edit the server while running.) 
- Rotate logs

- Start Arma 2 server
- Start bec.

The idea is that BEC will execute that batfile whenever the server is up for 3 hours. I would love to have some help with making those .bat files. Feel free contact me! 

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Basically what i worked on was this; but its not working for us. 

@echo off

:: FIND RUNNING PROCESSES
tasklist /nh /fi "imagename eq arma2oaserver.exe" | find /i "arma2oaserver.exe" >nul &&
tasklist /nh /fi "imagename eq bec.exe" | find /i "bec.exe" >nul && (
  echo Game is running, do things
 ) || (
  goto notrunning
)
 
:: REM 
goto end
 
:notrunning
echo The game was not running
 
:end
echo Script done

:: END THE PROCESSES 
echo.
echo KILL arma2oaserver.exe
set serverkill="D:\Overpoch server\Expansion\beta\"
cd /d %serverkill%
taskkill /im arma2oaserver.exe
echo.
echo Kill Bec.exe
set beckill="D:\Bec Namalsk\"
cd /d %beckill%
taskkill /im bec.exe
 
set file1="D:\Overpoch server\@DayZ_Epoch_Server\addons\extracted\dayz_server.pbo"
set file2="D:\Overpoch server\@DayZ_Epoch_Server\addons\dayz_server.pbo"
for %%f in (%file1%) do set date1=%%~tf
for %%f in (%file2%) do set date2=%%~tf
for /f %%i in ('dir /b /o:d %file1% %file2%') do set newest=%%i
if %newest%==1 (echo File is newer, copying... && copy %file1% %file2% && goto serverstart) else (echo File is not newer && goto serverstart)
 
timeout 10
 
:serverstart
echo.
echo STARTING DAYZ SERVER
:: START SERVER..
set dayzpath="D:\Overpoch server\"
cd /d %dayzpath%
start "" "DayZ_Overpoch_instance_15_namalsk.bat"
echo.
echo STARTING BEC
timeout 10
:: START BEC..
set becpath="D:\Bec Namalsk\"
cd /d %becpath%
start "" "bec.exe" -f Config.cfg
echo.
echo SERVER STARTED
 
pause
@exit

Is anyone willing to help us making the batch script work?

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...