Results 1 to 6 of 6

Thread: Periodic running of ntpdate

  1. #1
    Join Date
    Jan 2012
    Beans
    245

    Periodic running of ntpdate

    Hi all

    several times a day (when I remember..) I run the following in terminal:
    Code:
    glenn@design:~$ sudo ntpdate 2.nz.pool.ntp.org
    [sudo] password for glenn: 
    21 Nov 04:01:18 ntpdate[4084]: step time server 119.47.118.129 offset 91.031078 sec
    glenn@design:~$
    Is there an easy way that I can automate that process so it runs every 6 hours or so?

    I know nothing. nothing.

    Glenn

  2. #2
    Join Date
    May 2008
    Location
    UK
    Beans
    1,451
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Periodic running of ntpdate

    Quote Originally Posted by Senior_Buckethead View Post
    Hi all

    several times a day (when I remember..) I run the following in terminal:
    Code:
    glenn@design:~$ sudo ntpdate 2.nz.pool.ntp.org
    [sudo] password for glenn: 
    21 Nov 04:01:18 ntpdate[4084]: step time server 119.47.118.129 offset 91.031078 sec
    glenn@design:~$
    Is there an easy way that I can automate that process so it runs every 6 hours or so?

    I know nothing. nothing.

    Glenn
    I would suggest that this is the wrong thing to do - what you really need is to get the ntp deamon running on your pc so that it keeps your machine in step, and should also prevent any nasty step changes which could throw some pograms off.

    https://help.ubuntu.com/12.04/serverguide/NTP.html - see the section on ntpd.
    Tony - Happy to try to help.
    Unless otherwise stated - all code posted by me is untested. Remember to Mark the Thread as Solved.
    Ubuntu user number # 24044 Projects : TimeWarp - on the fly Backups

  3. #3
    Join Date
    Nov 2005
    Location
    Lincolnshire, UK
    Beans
    1,461
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Periodic running of ntpdate

    Quote Originally Posted by Tony Flury View Post
    I would suggest that this is the wrong thing to do - what you really need is to get the ntp deamon running on your pc so that it keeps your machine in step, and should also prevent any nasty step changes which could throw some pograms off.

    https://help.ubuntu.com/12.04/serverguide/NTP.html - see the section on ntpd.
    +1

    NTP/ntpd is the way to go to keep your PC always synchronised. Just install, configure and then forget all about it.

  4. #4
    Join Date
    Jan 2012
    Beans
    245

    Re: Periodic running of ntpdate

    Ok, have installed ntp.
    now run
    Code:
    glenn@design:/etc$ sudo ntpq -p
    and got:
    Code:
    glenn@design:/etc$ sudo ntpq -p
         remote           refid      st t when poll reach   delay   offset  jitter
    ==============================================================================
    +kgb.comnet.bg     209.81.9.7           2 u   25   64  377  383.758  1259.15 689.834
    +89.149.57.26          128.10.254.7       2 u   16   64  377  395.395  1276.78 700.364
    +prrr.se                     192.36.144.22     2 u   12   64  377  338.570  1279.76 706.608
    *205-196-146-72.    209.51.161.238  2 u   34   64  377  227.348  1230.83 683.339
    +europium.canoni 193.79.237.14     2 u   31   64  377   377.648  1236.90 688.264
    glenn@design:/etc$
    Nay of those bad? Some look sus. If so, how do I remove them?

    The time servers i have used are:
    server msltime1.irl.cri.nz
    server msltime2.irl.cri.nz

    webpage: http://msl.irl.cri.nz/services/time-...er-information
    Glenn.
    Last edited by Senior_Buckethead; November 21st, 2012 at 10:25 AM. Reason: More information

  5. #5
    Join Date
    Nov 2005
    Location
    Lincolnshire, UK
    Beans
    1,461
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Periodic running of ntpdate

    Senior_Buckethead: AIUI, the longer NTP runs the more accurate the time becomes. Your numbers (delay/offset/jitter etc) do seem quite a bit higher than mine and so it maybe that these will improve after a longer period of running.

    However, although you appear to be based in NZ, I suggest you may get better results by using "pool" servers, which automatically uses different servers in your area to even out load.

    I would try editing /etc/ntp.conf and change your two servers for the following four servers:
    Code:
    server 0.pool.ntp.org
    server 1.pool.ntp.org
    server 2.pool.ntp.org
    server 3.pool.ntp.org
    Then restart ntpd:
    Code:
    sudo /etc/init.d/ntp reload
    Enter "ntpq -p" and see what numbers you get. Then try entering "ntpq -p" after a few hours and see if things get more accurate. (Note that this does not need the sudo prefix).

    As a real "sanity check", check your PC time against an analogue radio time signal or a GPS/satnav receiver. It should be spot-on.

  6. #6
    Join Date
    Jan 2012
    Beans
    245

    Re: Periodic running of ntpdate

    Cheers Zill.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •