Jump to content
Sign in to follow this  
james312

How to start server with bat file ? (dedicated server , not local)

Recommended Posts

Hi every1. I have small problem with my server. Id like to create autorestart script in scheduler.xml but i dont know how to start server with bat file. I found that :


start Expansion/beta/arma2oaserver.exe -port=2302 "-config=dayz_1.chernarus/config.cfg" "-cfg=dayz_1.chernarus/basic.cfg" "-profiles=dayz_1.chernarus" -name=Bliss "-mod=@DayZ;@bliss_1.chernarus;" -noPause -noSound -cpuCount=4 -maxMem=4096 -bandwidthAlg=2 -exThreads=7
cls
@exit

but i dont have any exe files.

Some1 will help me ?

my hosting : xstreamgaming.net

Share this post


Link to post
Share on other sites

Is this what you need for inside "Scheduler.xml"

<job id="5">

<time>03:00:00</time>

<delay>000000</delay>

<day>1,2,3,4,5,6,7</day>

<loop>0</loop>

<cmd>#restart</cmd>

<cmdtype>0</cmdtype>

Share this post


Link to post
Share on other sites

you need to use taskkill to end the current process

something along the lines of


@echo off
echo.
echo KILL arma2oaserver_1.exe
taskkill /im arma2oaserver_1.exe
echo.
ping 127.0.0.1 -n 10 >NUL
echo.
cd "PATH TO SERVER DIRECTORY"
@start /HIGH Expansion/beta/arma2oaserver.exe -port=2302 "-config=dayz_1.chernarus/config.cfg" "-cfg=dayz_1.chernarus/basic.cfg" "-profiles=dayz_1.chernarus" -name=Bliss "-mod=@DayZ;@bliss_1.chernarus;" -noPause -noSound -cpuCount=4 -maxMem=4096 -bandwidthAlg=2 -exThreads=7
echo.
ping 127.0.0.1 -n 20 >NUL
echo START BEC
echo.
:: start bec
cd "PATH TO BEC"
start "" "bec.exe" -f config.cfg

edit the paths,save it as a batch file as restart.bat

and put it in your server directory

in your scheduler.xml put this


<job id="5">
<time>16:00:00</time> <!-- run @ 4:00 -->
<delay>000000</delay>
<day>1,2,3,4,5,6,7</day>
<loop>1</loop>
<cmd>[color=#ff0000]PATH TO SERVER[/color]\restart.bat</cmd>
<cmdtype>1</cmdtype>
</job>

you shouldnt use #restart for dayz servers as this only restarts the mission not the server

add me on skype if you dont understand what to do and ill help you out

edit the pings are just there to give the pc a bit of time

Edited by AmberHelios
  • Like 1

Share this post


Link to post
Share on other sites

Is this what you need for inside "Scheduler.xml"

<job id="5">

<time>03:00:00</time>

<delay>000000</delay>

<day>1,2,3,4,5,6,7</day>

<loop>0</loop>

<cmd>#restart</cmd>

<cmdtype>0</cmdtype>

this restart only mission , not server

  • Like 1

Share this post


Link to post
Share on other sites

oh sorry you cant use batch files with xstreamgaming they use acp and you dont hve rdp/vnc access the best way to do it is set up bec to run the messages to say the server is going to restart and then use the control panel restart option in the task section at the top

i havent seen the control panel for these before but i can help you set this up if you want

Edited by AmberHelios
  • Like 1

Share this post


Link to post
Share on other sites

AmberHelios ty 4 info but as i said i dont have any exe's on ftp. But i will try it

yep i have restart options in control panel but i thought scheduler will be better options. but if i cant... ok :)

Edited by james312
  • Like 1

Share this post


Link to post
Share on other sites

feel free to add me on skype you can only use batch restarts on dedicated servers not gsp like you have

skype is on my profile

  • Like 1

Share this post


Link to post
Share on other sites

yeah that will restart your server at the time listed just set up bec to display the restart messages like this


<!-- INTERNAL COMMANDS -->
<job id="0">
<time>15:40:00</time>
<delay>000000</delay>
<day>1,2,3,4,5,6,7</day>
<loop>0</loop>
<cmd>say -1 Server will Auto restart in 20 min</cmd>
<cmdtype>0</cmdtype>
</job>
<!-- INTERNAL COMMANDS -->
<job id="1">
<time>15:45:00</time>
<delay>000000</delay>
<day>1,2,3,4,5,6,7</day>
<loop>0</loop>
<cmd>say -1 Server will Auto restart in 15 min</cmd>
<cmdtype>0</cmdtype>
</job>
<!-- INTERNAL COMMANDS -->
<job id="2">
<time>15:50:00</time>
<delay>000000</delay>
<day>1,2,3,4,5,6,7</day>
<loop>0</loop>
<cmd>say -1 Server will Auto restart in 10 min</cmd>
<cmdtype>0</cmdtype>
</job>
<!-- INTERNAL COMMANDS -->
<job id="3">
<time>15:55:00</time>
<delay>000000</delay>
<day>1,2,3,4,5,6,7</day>
<loop>0</loop>
<cmd>say -1 Server will Auto restart in 5 min</cmd>
<cmdtype>0</cmdtype>
</job>

<job id="4">
<time>15:59:00</time>
<delay>000000</delay>
<day>1,2,3,4,5,6,7</day>
<loop>0</loop>
<cmd>say -1 Server will Auto restart in 1 min</cmd>
<cmdtype>0</cmdtype>
</job>

just change the time to what you use and you will get warning messages and then the server will restart

just so you know the times are the local time of the machine the server is located on the best way to find what time your box is running at is to join the server check the logs for your logon and work out the time difference.

hope this makes some sort of sense

  • Like 2

Share this post


Link to post
Share on other sites

AmberHelios ty 4 info but as i said i dont have any exe's on ftp. But i will try it

yep i have restart options in control panel but i thought scheduler will be better options. but if i cant... ok :)

You dont need any .exe you need a .bat as you are wanting a windows batch file to do the restarts for you.

The restart batch files are good because you can add vehicle cleanup and creation commands in, also log cycling :)

Share this post


Link to post
Share on other sites

i mean there is .exe in .bat script and i dont have any on ftp.

btw. http://www.picshot.p.../Bez tytułu.png

recur every : 1 day

repeat every : 3hours

for : what here ? without changes ?

just so you know the times are the local time of the machine the server is located on the best way to find what time your box is running at is to join the server check the logs for your logon and work out the time difference.

i will use delay against time... hmmm but this will work?

Edited by james312
  • Like 1

Share this post


Link to post
Share on other sites

AmberHelios is the man! Thank you so much for all the help! Very much appreciated!

  • Like 1

Share this post


Link to post
Share on other sites

@chisel anytime mate

@panda he doesnt have any rdp access so he cant do a batch file it wont work hes using a gsp not a dedi

@james312 the pic you have shown is restarting your server every min. you need to know the time the delay will not work for what you want

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  

×