VDS Time

Ask questions about dedicated servers here and we and other users will do our best to answer them. Please also refer to the self-help section for tutorials and answers to the most commonly asked questions.
Post Reply
Hot Carl
A semi-regular
A semi-regular
Posts: 28
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Sat Mar 24, 2012 6:23 am

VDS Time

Post by Hot Carl »

Howdy,

Does anybody have a solution to getting the time on my VDS set correctly? I have tried setting the date/time with the date command, I have tried manually setting the hwclock and then syncing the system date/time with the hw clock date/time. For some reason it won't stay.

On another forum I read that I should set the hw clock, sync then reboot. I rebooted the machine and it comes up with a crazy time. The ss I posted was taken at 15:16 CST and the ss is showing 16:04. On that same forum I was reading somebody said that the box time wasn't set correctly so my vds wouldn't show the right time. Only reason I am asking is because it's very confusing when I am trying to read logs and the date/time is all fubar'd.

I am running the Centos 5.6 64 bit.

Image



Thank you for any solutions or suggestions!

Hot Carl
User avatar
Edge100x
Founder
Founder
Posts: 13129
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: VDS Time

Post by Edge100x »

To ensure the correct time, it would be best to install and run ntpd. Here's one guide for how to do this:

http://www.cyberciti.biz/faq/howto-inst ... ver-clock/
Hot Carl
A semi-regular
A semi-regular
Posts: 28
Joined: Sat Mar 24, 2012 6:23 am

Re: VDS Time

Post by Hot Carl »

Wow I feel like a dummy, the same forum I was reading those other comments on was talking about it but I had never used it before.

I installed then synced the hw clock with the system and now everything is dandy.

Learn something new everyday!

Thanks for your help and thanks for the quick response,
Carl :D
User avatar
Edge100x
Founder
Founder
Posts: 13129
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: VDS Time

Post by Edge100x »

Not a problem :)

The hardware clock output will reset every time that your VDS is rebooted (since it is based on the Xen clock, which seems to be off), but ntpd should start with the system and correct this as part of the process.
Hot Carl
A semi-regular
A semi-regular
Posts: 28
Joined: Sat Mar 24, 2012 6:23 am

Re: VDS Time

Post by Hot Carl »

John,

Sorry to bring this up again but ntpd didn't solve my problem. My clock is running fast for some reason and I am unable to fix it. I have googled and googled and tried several things but it still isn't working. For example around noon I re-sync'd with servers and everything was ok, it is now 1403 CST and my server thinks it is 1411 CST.

Do you have any suggestions on how I can keep this in sync? Only reason I am asking is our TS server is giving out a warning telling me the time isn't right and it could cause issues.

Thanks,
Carl
Hot Carl
A semi-regular
A semi-regular
Posts: 28
Joined: Sat Mar 24, 2012 6:23 am

Re: VDS Time

Post by Hot Carl »

Sorry to double post, but I just saw a post on another forum about deleting the drift file. I just did that and will let it run for 24 hours to see if that does the trick.

I will post back if that doesn't work.

Thanks,
Carl
User avatar
Edge100x
Founder
Founder
Posts: 13129
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: VDS Time

Post by Edge100x »

Are you absolutely certain ntpd is running correctly? It's meant for exactly this scenario. Check "ps auxw | grep ntpd" to make sure that it's started, and also make sure that the time is correct before it begins (because it will take ages to fix it otherwise, by default). Look in /var/log/messages for errors that it might be spitting out, as well.

If you can't get ntpd working right, you could set up a cronjob to run ntpdate -u (or the equivalent ntpd command) regularly, but that's a stopgap measure.
Post Reply