Restarting two servers

Papahyooie

New Member
I cannot seem to get a batch file to work to restart both of my servers running on the same machine.

One server is running on port 2312, the other on 2350. When I run my batch file (or trigger it with BEC) it always hangs up somewhere in between. It starts one or the other server, it may start both servers, BEC may not start on one of more of the servers... I can't figure out what's up. Here is the script I'm trying (it has gone through several revisions to try to fix it...)

taskkill /im arma2oaserver.exe
taskkill /f /im bec.exe
taskkill /im arma2oaserver.exe
taskkill /f /im bec.exe

timeout 10

:: start the server..
set dayzpath="E:\BattleBorne Epoch"
cd /d %dayzpath%
start "arma2" /min "arma2oaserver.exe" -port=2312 "-config=instance_11_Chernarus\config.cfg" "-cfg=instance_11_Chernarus\basic.cfg" "-profiles=instance_11_Chernarus" -name=instance_11_Chernarus "-mod=@DayZ_Epoch;@DayZ_Epoch_Server;"

timeout 30
:: start the server..
set dayzpath="E:\BattleBornePVPUtes"
cd /d %dayzpath%
start "arma2" /min "arma2oaserver.exe" -port=2350 "-config=instance_2_utes\config.cfg" "-cfg=instance_2_utes\basic.cfg" "-profiles=instance_2_utes" -name=instance_2_utes "-mod=@DayZ_Epoch;@DayZ_Epoch_Server;"

timeout 160
:: start bec
set becpath="C:\Users\Nick\Desktop\Bec2"
cd /d %becpath%
start "StartBEC" "startbec.bat"
timeout 10
:: start bec
set becpath="C:\Users\Nick\Desktop\Bec"
cd /d %becpath%
start "StartBEC" "startbec.bat"

timeout 3
cls
@exit


....

Thanks guys. Any help would be appreciated!
 
I had this problem before just use two seprate bats and make one bat run the 2 so you can start the server with 1 bat, if this doesnt work I could write a quick batach for you.
 
Ok, so the problem is I just need to have them both isolated from each other? I figured having one batch file triggered by one server's BEC would be a more elegant solution. Plus, I tried it with two different restart.bat files, but the problem I was having there was that the first server's BEC would trigger its restart.bat file, but the taskkill command would kill *both* servers, which would make the second one never trigger its restart.bat because its BEC was already dead. How do you get around that?
 
It's just a stock epoch server atm, with a few mods. Add a decent spawn loadout, and poof you have a pvp server lol. I'll probably get rid of the zombies at some point, add kill messages, etc. Nothing too fancy.
 
It's just a stock epoch server atm, with a few mods. Add a decent spawn loadout, and poof you have a pvp server lol. I'll probably get rid of the zombies at some point, add kill messages, etc. Nothing too fancy.
Its just such a small map.
 
Exactly. Keeps everyone closer together for more constant action. Plus, I don't have a super high traffic server, so on chernarus people are too spread out to make much of a death match.
 
It isn't up right now, as I'm working out the restarting issues. But my normal chernarus server is battle borne.no-ip.biz port 2312.

And you must have edited your first reply, and now I'm confused lol.

So I need to use BEC to trigger a bat file. In that bat file, run two separate bat files, and in those separate bat files, restart each server?
 
What I would do is instead of starting both servers in one bat start them in 2 seperate ones and use BEC to run a bat to kill the tasks.
 
Could you show me a quick example? The BEC would trigger a bat to only kill the tasks? Or would that same bat call two more bats to start the servers and bec?
 
So like, have BEC trigger this:

taskkill /im arma2oaserver.exe
taskkill /f /im bec.exe
taskkill /im arma2oaserver2.exe
taskkill /f /im bec2.exe

timeout 10

:: start the server..
start E:\BattleBorne Epoch\DayZ_Epoch_instance_11_Chernarus.bat

timeout 30
:: start the second server..
start E:\BattleBornePVPUtes\DayZ_Epoch_instance_2_Utes.bat

cls
@exit


...

and each of those bat files start their respective server and BEC?


Also, have you ever had the problem of the restarts leaving behind blank cmd windows? I can't figure that one out either.
 
Well make sure all the bats have
Code:
cls
@exit
And I would make the second one timeout 120 not 30 just to be safe.
 
Back
Top