DayZ
Static Nov 28, 2024 @ 10:32am
SteamCMD Dayz Server Timing Off
So I've been dealing with a timing issue on my personal dayz server where the count down for the restart is off by about 24 minutes, gaining that amount every cycle. I don't know if its something I did or the most recent update but I want the server to restart at 3:30 and 15:30 est every day. I pulled the console logs and do notice the time is off by a few seconds every minute between each shut down warning. 15 seconds in just 5 minutes.
The actual system time is correct and is synced with my own NTP server occasionally but I can't imagine it is the system time because that is a large gain. I would see the dependency between my desktop and server in a matter of minutes long before it has a chance to sync.

The times from the console log:
4:18:33 - shutdown
4:17:27 - 1 minute warning
4:16:25 - 2
4:15:23 - 3
4:14:21 - 4
4:14:18 - 5
4:08:08 - 10
3:57:46 - 20
3:47:24 - 30
3:31:53 - 45
2:45:18 - 90

And what I have in the messages.xml file:
<message>
<deadline>720</deadline>
<shutdown>1</shutdown>
<countdown>1</countdown>
<text>#name will shutdown in #tmin minutes.</text>
</message>

Any help would be appreciated!
Last edited by Static; Nov 28, 2024 @ 2:48pm
< >
Showing 1-10 of 10 comments
_KC76_ Nov 28, 2024 @ 7:41pm 
Does the Run Timer and Restart Pause Timer in the Start Batch match exactly to the times you set up in Messages?

For 12 hour restarts, I would set the server to run for 43,080 seconds, then shut down, and Pause for 120 seconds before Restarting .. this equals the total 12 hours, or 43,200 seconds.

If you don't have many, or any mods, you could reduce the Pause timer to 20 seconds, and add back those 100 seconds to the Server Run timer ( = 43,180 seconds).

Edit: I restart on a 6 hour schedule, so the last 6 lines of my Start.bat are as follows:
::Time in seconds before kill server process (21600 = 6 hours) timeout 21590 taskkill /im DayZServer_x64.exe /F ::Time in seconds to wait before.. timeout 10 ::Go back to the top and repeat the whole cycle again goto start

And my messages.xml is a little simpler:
<message> <deadline>360</deadline> <shutdown>1</shutdown> <text>#name will shutdown in #tmin minutes.</text> </message>
Last edited by _KC76_; Nov 28, 2024 @ 7:48pm
Static Nov 29, 2024 @ 10:11am 
I don't use taskkill in the batch, that is redundant, and can potentially cause data corruption.

I can see the error occurring as the count down happens, every 1 minute gains a second or two. It isn't a problem in the batch file, the problem is either in dayz it's self, or a systemic issue in the OS, but if it was the OS I would imagine I would see the problem on the RTC, the system sync'd the time at 10pm last night, thats 15 hours ago. The system time would be off by over half an hour by now.

My batch just waits until the task terminates once the countdown in the server messages is complete.
@echo off :start ::Server name set serverName=******************** ::Server files location set serverLocation="C:\Program Files (x86)\SteamCMD\dayz_ds" ::Server Port set serverPort=2302 ::Server config set serverConfig=serverDZ.cfg ::Logical CPU cores to use (Equal or less than available) set serverCPU=4 ::Sets title for terminal (DONT edit) title %serverName% batch ::DayZServer location (DONT edit) cd "%serverLocation%" echo (%time%) (%date%) %serverName% started. ::Launch parameters (edit end: -config=|-port=|-profiles=|-doLogs|-adminLog|-netLog|-freezeCheck|-filePatching|-BEpath=|-cpuCount=) start "DayZ Server" /wait /min "DayZServer_x64.exe" -config=%serverConfig% -port=%serverPort% "-mod=@CF;@VPPAdminTools" -profiles=profiles -cpuCount=%serverCPU% -dologs -adminlog -netlog -freezecheck -limitfps=160 -bepath=C:\Program Files (x86)\SteamCMD\dayz_ds\battleye echo (%time%) (%date%) %serverName% restarting in... ::Time in seconds to wait before restart... timeout 10 ::Go back to the top and repeat the whole cycle again goto start
Static Nov 29, 2024 @ 10:14am 
Let me clarify. If I did put taskkill in the batch You would get a warning that the server is going to shutdown in 30 minutes and 5-6 minutes later the server would just crash and anyone who wasn't ready would potentially lose stuff or get corrupted.

A more appropriate fix would be to reduce the countdown from 720 minutes to 696 minutes but this is a bit of a hack. Why is this happening and can it be fixed or did the dev's screw something up. Or are my server files corrupted somewhere?
Last edited by Static; Nov 29, 2024 @ 10:21am
_KC76_ Nov 29, 2024 @ 12:57pm 
It was my understanding that the Messages.xml was the redundant file (basically just there to display the warning to players), and that the TaskKill in the Batch was the controlling code .. perhaps I am mistaken.

I run my server via the DayZ Server App, rather than SteamCMD (I do have SteamCMD for my Rust servers), so this may be a reason I am not seeing the same time-differentials you are, as well.
Static Nov 29, 2024 @ 4:58pm 
Dayz server app?
SmashT Nov 30, 2024 @ 12:41am 
Originally posted by Static:
Dayz server app?

Probably just the DayZ Server tool on steam, could try something like CFTools though and see if that works better
_KC76_ Nov 30, 2024 @ 10:26am 
Originally posted by Static:
Dayz server app?
Yeah, the DayZ Server is available through the Steam Library as an App .. you don't have to use SteamCMD to install a Local server. Automatic updates of Vanilla files and Missions.
Static Nov 30, 2024 @ 5:11pm 
Originally posted by _KC76_:
Originally posted by Static:
Dayz server app?
Yeah, the DayZ Server is available through the Steam Library as an App .. you don't have to use SteamCMD to install a Local server. Automatic updates of Vanilla files and Missions.

If I remember correctly, don't you have to be signed into steam for it to run. And since I host this on a dedicated server while I play the game on my desktop would that cause issues?
_KC76_ Nov 30, 2024 @ 6:51pm 
Originally posted by Static:
Originally posted by _KC76_:
Yeah, the DayZ Server is available through the Steam Library as an App .. you don't have to use SteamCMD to install a Local server. Automatic updates of Vanilla files and Missions.

If I remember correctly, don't you have to be signed into steam for it to run. And since I host this on a dedicated server while I play the game on my desktop would that cause issues?
No, you do not need to be signed in to steam to run the server, only to play as a Client.
- Use your PC that is signed in to "install" the DayZ Server, then copy the entire Server folder to a USB stick and transfer it to your Dedicated machine (or, conversely, sign in to steam from the Server PC, and install the Server, then sign out of that PC, and sign in on your client Gaming PC).
- In your particular instance, it's probably 6 vs Half-Dozen scenario, since you'd still have to either copy the updated files, or sign in to the Server PC to do the "automatic updates".
Static Nov 30, 2024 @ 7:14pm 
looked into it, same as cmd, just no gui.
< >
Showing 1-10 of 10 comments
Per page: 1530 50

Date Posted: Nov 28, 2024 @ 10:32am
Posts: 10