I use the two hive.ini method. It works nicely. You need BEC and root access to arma2 or server install folder for this though.
First you have to set your Scheduler.xml to the restart times you want. I have mine set for 3 hour restarts at 3,6,9,12. At 21:00:00 (9PM) I have it set to run a special .bat file to make it night. At all other restarts I have it set to run the regular .bat file to make it day. Like this:
Day:
Code:
<job id="21">
<time>12:00:00</time>
<day>1,2,3,4,5,6,7</day>
<loop>1</loop>
<cmd>A:\restartserver.bat</cmd>
<cmdtype>1</cmdtype>
</job>
Night:
Code:
<job id="54">
<time>21:00:00</time>
<day>1,2,3,4,5,6,7</day>
<loop>1</loop>
<cmd>A:\restartservernight.bat</cmd>
<cmdtype>1</cmdtype>
</job>
And here are the corresponding .bat files:
Day:
Code:
@echo off
taskkill /f /fi "status eq not responding" /im arma2oaserver.exe
taskkill /f /im arma2oaserver.exe
timeout 1
taskkill /f /fi "status eq not responding" /im arma2oa.exe
taskkill /f /im arma2oa.exe
timeout 1
taskkill /im Bec.exe
timeout 1
cd A:\cfgdayz
start "" "rotate_logs.bat"
timeout 5
xcopy /Y A:\cfgdayz\day\HiveExt.ini A:\cfgdayz\
timeout 1
cd A:\Arma2\SteamApps\common\Arma 2 Operation Arrowhead
start "arma2" /high "Expansion\beta\arma2oaserver.exe" -port=2302 "-config=A:\config.cfg" "-cfg=A:\basic.cfg" "-profiles=A:\cfgdayz" -name=cfgdayz "-mod=@DayZ_Epoch;@DayZ_Epoch_Server;" -nosplash -noSound -noPause -bandwidthAlg=2
timeout 6
set becpath="A:\Bec\"
cd /d %becpath%
start "" "Bec.exe" -f Config.cfg
Night:
Code:
@echo off
taskkill /f /fi "status eq not responding" /im arma2oaserver.exe
taskkill /f /im arma2oaserver.exe
timeout 1
taskkill /f /fi "status eq not responding" /im arma2oa.exe
taskkill /f /im arma2oa.exe
timeout 1
taskkill /im Bec.exe
timeout 1
cd A:\cfgdayz
start "" "rotate_logs.bat"
timeout 5
xcopy /Y A:\cfgdayz\night\HiveExt.ini A:\cfgdayz\
timeout 5
cd A:\Arma2\SteamApps\common\Arma 2 Operation Arrowhead
start "arma2" /high "Expansion\beta\arma2oaserver.exe" -port=2302 "-config=A:\config.cfg" "-cfg=A:\basic.cfg" "-profiles=A:\cfgdayz" -name=cfgdayz "-mod=@DayZ_Epoch;@DayZ_Epoch_Server;" -nosplash -noSound -noPause -bandwidthAlg=2
timeout 3
set becpath="A:\Bec\"
cd /d %becpath%
start "" "Bec.exe" -f Config.cfg
timeout 1
As you can see they are identical except one overwrites the HiveExt.ini file for day and the other for night. The HiveExt.ini files are also identical except the time settings:
In day HiveExt.ini (starts at Noon):
Code:
[Time]
;Possible values: Local, Custom, Static
;You cannot use Static on OFFICIAL Hive, it will just revert to Local
Type = Static
;If using Custom type, offset from UTC in hours (can be negative as well)
;Offset = -8
;If using Static type (Hour value always the same on every server start), the value (0-24) to set the Hour to
Hour = 12
In night HiveExt.ini (starts at 8PM):
Code:
[Time]
;Possible values: Local, Custom, Static
;You cannot use Static on OFFICIAL Hive, it will just revert to Local
Type = Static
;If using Custom type, offset from UTC in hours (can be negative as well)
;Offset = -8
;If using Static type (Hour value always the same on every server start), the value (0-24) to set the Hour to
Hour = 20