Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have NTP installed and setup on an hourly cron and it shows 5 minutes past what my cell phone and my PC both show. Is there a way for me to verify that it's trying to sync the time?

It's syncing with..

pool.ntp.org ntp.ubuntu.com (or whatever the ubuntu url is)

share|improve this question
1  
Have you considered that your cell phone and PC are out of sync and not the server? –  joeqwerty Sep 14 '10 at 22:12

3 Answers 3

up vote 3 down vote accepted

You can run "ntpdate 0.us.pool.ntp.org" or whatever server you wish to use, to verify that you're able to sync. The output of this command should show you the server on the remote host and the difference on your local machine.

If you're using ntpd, and it's running as a daemon, you will need to stop that first. Also, if are you running ntpd, you shouldn't need a cronjob as it will keep the time in sync on it's own.

If ntpd is in fact running, you might just not be stepping the time fast enough. If your current system time is very far off, it will not make a huge time jump to get you in sync.

share|improve this answer
    
It's more in sync than it was yesterday, so it appears it's running and it's just gonna take some time. –  Webnet Sep 15 '10 at 13:08
    
Now it's more off-sync than it was the day before.... –  Webnet Sep 16 '10 at 14:27

If it's a server, use ntpd. For ubuntu, install that with:

sudo aptitude install ntp

The way you can check on it is through the ntpq program. use it something like this:

user@myhost:~$ ntpq
ntpq> peer
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 europium.canoni 193.79.237.14    2 b   48   64  377  141.805   42.254   9.901

This tells you that it's synced up with one host, and that it's about 42 milliseconds off from it. If it isn't syncing up, you might see a reach like 0, which means it can't connect to your designated host. You also might see a giant offset; NTP gets scared when it sees too big a time difference, and so you'll have to set the clock manually with ntpdate first, with something like sudo ntpdate tick.usno.navy.mil.

share|improve this answer

What's the cronjob? Unless it ends with 2&>/dev/null or similar it should email some output hourly to the MAILTO=" address at the top, or to root if that's not present (try removing the end part to make sure if it is there).

To verify it's running, check /var/log/cron.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.