Go to TogaWare.com Home Page.
GNU/Linux Desktop Survival Guide
by Graham Williams
Google

ntpdate


If you only have irregular access to the Internet then ntpdate is useful. The package provides the ntpdate command to query an NTP server and to update your clock. You can do this manually as you see fit with:



  $ ntpdate ntp.togaware.com

The advantage is that you will not have regular net transmissions as with the NTP server. This could save you up to 4MB per day. This could also be done as a cron job, for example.

For irregular access through a modem using PPP though, a good idea is to create a script file in /etc/ppp/ip-up.d called ntpdate containing:



#!/bin/sh

#invoke ntpdate to set time from system clock
if [ -x /usr/sbin/ntpdate ]; then
        /usr/sbin/ntpdate -s -t 5 ntp.togaware.com
        /sbin/hwclock --systohc
fi

Make sure the script is executable:



  # chmod a+rx /etc/ppp/ip-up.d/ntpdate

Then each time you connect the local clock will be synchronised with the NTP server.


Copyright © 1995-2014 Togaware Pty Ltd
Support further development through the purchase of the PDF version of the book.
Brought to you by Togaware.