The title says it all. Im not a linux admin but I do have my feet wet in the linux community. I was hoping someone could shed some light on possible reasons this is happening?

8 Spice ups

Looks like you are not synced to a time server.

At the command line (as root or as sudo), enter:

ntpdate us.pool.ntp.org

and it should update your system clock.

5 Spice ups

You can edit ntpd.conf to set the time server to synch with too to keep the time in synch

2 Spice ups

Yup, it’s been covered. NTP issues.

3 Spice ups

Donges, That did work but How do I get it to do it automatically? or is that what Alex was talking about?

Add an entry to your crontab (command is crontab -e):

run ntpdate to set system time

7 5 * * * /usr/sbin/ntpdate us.pool.ntp.org >>/tmp/ntpdate.log

which sets ntpdate to run at 7 minutes after 5 each morning. Writes results to a log file.

2 Spice ups

Many thanks guys. I will try this and let you know. I will report back say monday or tuesday and confirm if Donges fix worked for me.

Linux has many more advanced features than Windows or Mac, including the ability to time travel

3 Spice ups

Install and configure xntpd. It is a service that will keep your clock accurate all day. You can set it up to synchronize to time.nist.gov and time-a.timefreq.bldrdoc.gov or time-b.timefreq.bldrdoc.gov. Both of these agencies are in sync with the official atomic clock in Greenwich.

Also, if you enable pll, it will adjust the hardware clock. If the hardware clock is wrong, then at the next reboot the system time will be wrong until xntpd is started. Bad things can happen if you reboot and it’s 10 minutes ago, depending on what your system is running.

1 Spice up

If you’re trying to update the time on a VM, then you should also fix the hypervisor host’s time settings. The Linux box will set itself to the virtual “hardware” clock on each boot.

Agreed, but there should be a mechanism within the hypervisor host to do this rather than within the VMs. If you have 10 VMs on a host, and one of them changes the time but the others have no idea… Could be bad, especially if there’s a database involved because everything that happens in every database is somehow a slave to the official timestamp. In this case the correct way to handle the time issue is to have one particular VM or the hypervisor host itself synchronize and update the hardware clock. The other VMs should sync up and NOT update the clock. I didn’t think of this (thanks for bringing it up) because I run SPARC. My rules for VMs and managing them are entirely different than yours.

Generally speaking, the best practice for time synchronization is to have a dedicated timehost synchronize to the servers I mentioned (there are others, and there is no limit on the number of servers AFAIK) and to have each physical machine use that as its time server.

1 Spice up

ntpdate to update the time immediately and then use ntp.conf and start your ntpd to keep it up to date.

http://www.tldp.org/LDP/sag/html/basic-ntp-config.html

Or, as it looks like others have mentioned, use your VM host to keep their time.

Looks like Donges answer fixed my issue and appears to be holding Strong. Thanks everyone for great info and the precautions.

1 Spice up