1

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)

1
  • 1
    Have you considered that your cell phone and PC are out of sync and not the server?
    – joeqwerty
    Sep 14, 2010 at 22:12

3 Answers 3

3

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.

2
  • It's more in sync than it was yesterday, so it appears it's running and it's just gonna take some time.
    – Ben
    Sep 15, 2010 at 13:08
  • Now it's more off-sync than it was the day before....
    – Ben
    Sep 16, 2010 at 14:27
1

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.

0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .