Server database corrections on boot

Hey folks

I have looked all over the internet, and was unable to find anything (I might just be searching for the wrong stuff)
I have a dedicated server. I set i up myself and it's running just perfectly. I have had a few different setups running now, a normal server with the normal configurations (some stuff added like autorefuel, flip vehicle, heli lift and so on) and a PVP fun server (all spawn with good gear and there is loads of vehicles). Right now im running the PVP fun server. I am automatically starting the server with a batch file (ill paste it further down) on boot (i am also restarting the server with this file). The file is "Stolen/borrowed" from a post on this site (i think). It basically connects to the database, runs the server with the correct configuration files and then starts BEC. The file from this forum tried a "--cleanup" command, with the database, but it fails. What i would like to know is: What commands do i have to put into the file to make it spawn vehicles, repair and refuel them and cleanup the database on restart?

The file:
Code:
:: Server Start and Restart batch for DayZ Server Controlcenter written by Crosire
:: This is just a sample edit of Crosires file for current version Control Center, made by GermanMG. You NEED to adjust the settings first!
 
@echo off
 
:: Settings:
 
REM Turned all the relative paths into absolute paths to resolve issues people had with "file not found" errors
REM Main directory, very important!!! ""s are inserted further down the page, no need to add them here. No trailing "\" here.
set ARMApath=C:\Program Files (x86)\Steam\SteamApps\common\Arma 2 Operation Arrowhead
REM Set the instance number here.
set instance=1
REM build the location of BEC executable for this instance, keep the leading backslash \! Again, no ""s.
set BECpath=C:\Server\BEC
REM Set the port of the server here.
set port=2302
REM Set the server modlist here.
set mod=@dayz;@dayzcc
REM 1 = Generate new vehicles, 0 = Do not generate vehicles   
set vehicles=1
REM Path to an external batch file to execute. Set it to 0 if you don't use one.
set externalbat=0
 
REM Your MySQL connection details - you need this to generate vehicles directly into the DB
set dbhost=le IP
set dbport=3306
set dbuser=username
set dbpass=password
set dbname=dayz_chernarus
 
:: Do not edit from here on >>>>    HAHAHA
 
 
timeout 1
:initialize
cls
:: see if our settings are correct
echo ARMA main directory is: "%ARMApath%"
echo ARMA BEC directory is: "%ARMApath%%BECpath%"
cd /d "%ARMApath%"
echo Switched to ArmA 2 main directory:
echo %CD%
echo.
echo Killing current running server ...
taskkill /IM arma2oaserver_1.exe
echo.
if not "%externalbat%" == "0" (start %externalbat%)
echo.
if "%vehicles%" == "1" goto generate
goto start
 
 
:generate
timeout 1
echo Generating vehicles ...
"@dayzcc\mysql\bin\mysql.exe" -w [I]@dayz\addons\dayz_vehicles.pbo (does mot work)[/I] --host %dbhost% --port %dbport% --user %dbuser% --password %dbpass% --database %dbname% --cleanup
:: there are some more customization parameters possible here, like max. vehicle count etc.
echo.
echo.
 
:start
timeout 3
echo Starting server again ...
@start /REALTIME @dayzcc_config\%instance%\arma2oaserver_%instance%.exe -beta=Expansion\beta;Expansion\beta\Expansion -mod=%mod% -name=Server -config=@dayzcc_config\%instance%\config.cfg -cfg=@dayzcc_config\%instance%\basic.cfg -profiles=@dayzcc_config\%instance%\ -port=%port% -noCB -cpuCount=16 -maxMem=80048 -exThreads=1 -noPause -noSound
echo.
 
:start bec
timeout 2
echo starting BEC again...
cd /d "%BECpath%"
start "" "bec" -f Config.cfg
echo.
echo restart procedure completed
 
:: Do not edit until here <<<<

The server specs: (All servers are dedicated)
Remote database server:
OS: RedHat 6.3
300 GB SSD RAID 10
CPU: 4 x 2.8 Ghz CPU's (1 quad core Xeon)
RAM: 36 GB ram
Connection: 10 gigbit dedicated connection (not the same connection as the DayZ server)
The DayZ server:
16 x 3.2 Ghz Xeon CPU (4 Physical quad core CPU's)
80 GB ram
600 GB SSD Raid 10
Windows Server 2012 Enterprise

The servers are running nothing else than described.

Best regards and thanks in advance

//Warpten
 
Back
Top