Jump to content
Sign in to follow this  
HeadRox

Auto update server?

Recommended Posts

Anyone that can help me with an auto update script/bat for my server? 
Iv got this in my START.bat, maybe in this startup code so it does only update / not validate so i dont loose my edited files(events.xml etc.)

@echo off
TITLE DayZ SA Server - Status
COLOR 0A
:: Variables::
::DayZServer_64.exe path
set DAYZ-SA_SERVER_LOCATION="C:\dayzserver"
::Bec.exe path
set BEC_LOCATION="C:\dayzserver\battleye\Bec"
::::::::::::::

echo Agusanz
goto checksv
pause

:checksv
tasklist /FI "IMAGENAME eq DayZServer_x64.exe" 2>NUL | find /I /N "DayZServer_x64.exe">NUL
if "%ERRORLEVEL%"=="0" goto checkbec
cls
echo Server is not running, taking care of it..
goto killsv

:checkbec
tasklist /FI "IMAGENAME eq Bec.exe" 2>NUL | find /I /N "Bec.exe">NUL
if "%ERRORLEVEL%"=="0" goto loopsv
cls
echo Bec is not running, taking care of it..
goto startbec

:loopsv
FOR /L %%s IN (30,-1,0) DO (
	cls
	echo Server is running. Checking again in %%s seconds.. 
	timeout 1 >nul
)
goto checksv

:killsv
taskkill /f /im Bec.exe
taskkill /f /im DayZServer_x64.exe
goto startsv

:startsv
cls
echo Starting DayZ SA Server.
timeout 1 >nul
cls
echo Starting DayZ SA Server..
timeout 1 >nul
cls
echo Starting DayZ SA Server...
cd "%DAYZ-SA_SERVER_LOCATION%"
start DayZServer_x64.exe -config=serverDZ.cfg -port=2302 -dologs -adminlog -noFilePatching -BEpath=C:\dayZServer\battleye -profiles=C:\dayzserver\playerLogs
FOR /L %%s IN (45,-1,0) DO (
	cls
	echo Initializing server, wait %%s seconds to initialize Bec.. 
	timeout 1 >nul
)
goto startbec

:startbec
cls
echo Starting Bec.
timeout 1 >nul
cls
echo Starting Bec..
timeout 1 >nul
cls
echo Starting Bec...
timeout 1 >nul
cd "%BEC_LOCATION%"
start Bec.exe -f Config.cfg
goto checksv

Thanks for the help!

Edited by headrox
typo

Share this post


Link to post
Share on other sites
25 minutes ago, GeekBee said:

Use Task Scheduler from Windows, Link an .Bat 

Hi, sorry but i dont understand what you mean exactly.
I cant'seem to get my .bat to auto update before the server starts.
Maybe you cant elaborate on it?

Share this post


Link to post
Share on other sites
On 25.9.2018 at 1:44 AM, XxFri3ndlyxX said:

A quick and very easy way to install DayZ Server using batch file. Again nothing crazy but i'm sure this will help some people.

 

  • First you need to create a .bat file. Ex: DayZ_Server_Installer.bat
  • Then you add the following in the file you just created.

@echo off
set STEAM_CMD_LOCATION="C:\Servers\SteamCMD"
set STEAM_USERNAME="Your Steam Username"

cd "%STEAM_CMD_LOCATION%"
start "" steamcmd.exe +login "%STEAM_USERNAME%" "%STEAM_PASSWORD%" +force_install_dir %~dp0 +app_update 223350 validate
  • Save the .bat file.
  • Now you need to download SteamCMD Download Here
  • Put SteamCMD.exe into its own folder. Ex: C:\Servers\SteamCMD 
  • I created is own folder because it will download a bunch of Steam files which i do not want to be with my DayZ File server's.
  • Go back to your Bat file and add your SteamCMD Location. This would be in this case C:\Servers\SteamCMD
  • Save the bat file.
  • Create a folder for your DayZServer. EX: C:\Servers\DayZ\DayZServer
  • Put your bat file into the DayZ folder you just created.
  • Start the bat file.
  • Enter Your password when requested and then enter your steam guard code if asked.
  • It will now install DayZ Server Files. 
  • You can also use this bat file to update\validate your files.

Let me know if you have any problem.

 

 

  • Beans 1

Share this post


Link to post
Share on other sites

Remember doing this will result in a complete wipe of your server (serverDZ.cfg battleye.cfg etc..) it will be like a new fresh server. remove your cfg files before updating (Bec wont be affected) and just replace them after the update, If you have mods you will need to apply the mods to the new files in case the update was in the files also (dont reuse old modded files). I manually update my servers until the devs make the anon login for the server files available and hopefully we are able to see which files were updated so we have a clue as to the next step of updating the server, (choosing only updated files perhaps).

Edited by ICEMAN-FMCS

Share this post


Link to post
Share on other sites
13 hours ago, headrox said:

Hi, sorry but i dont understand what you mean exactly.
I cant'seem to get my .bat to auto update before the server starts.
Maybe you cant elaborate on it?

Take a Look at SaarPlayTV Post this an Update for the Server you have just only an Server restarter also You can per control start and stop etc. 

Exemple:

AM: 8:00 Stop Dayz Server

AM: 8:15 Start Updater

AM: 8:25 Start Dayz Server

and this is repeated daily or hours or Weekly,depending on how you set it

Share this post


Link to post
Share on other sites

Thanks all for the reply's!, great community!
Will try this.

Share this post


Link to post
Share on other sites

[SOLVED]


Strangely enough, for some reason all the sudden it doesn't want to update anymore?

This is from the CMD

 

[  0%] Checking for available updates...
[----] Verifying installation...
Steam Console Client (c) Valve Corporation
-- type 'quit' to exit --
Loading Steam API...OK.

Logging in user 'myUserName' to Steam Public...Logged in OK
Waiting for user info...\src\clientdll\clientjobremotestoragesync.cpp (2419) : Assertion Failed: Failed to write file after download (2)

\src\clientdll\clientjobremotestoragesync.cpp (2419) : Assertion Failed: Failed to write file after download (2)

OK
 Update state (0x5) validating, progress: 0.00 (0 / 0)
Error! App '223350' state is 0x606 after update job.

 

Anyone got an idea whats wrong?

 

*Solved it by running the batch as ADMINISTRATOR. Everything works now.

Edited by HeadRox

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×