[Dclug] [Ma-linux] "Time"
Alan McConnell
alan at patriot.net
Mon Aug 25 12:19:39 EDT 2008
On Mon, Aug 25, 2008 at 10:25:23AM -0400, Richard Rognlie wrote:
>
> If you are not already running NTP, you should.
Thanks for reminding me. I don't think I need another demon.
Running a script when I boot -- I shut down at night, boot in
the morning -- will be good enough for me.
> pool.ntp.org is a group of virtual servers that serve up NTP data
> freely See http://www.pool.ntp.org/ for more info.
This is great, since it seems to indicate that a small fish
like me can use 'pool.ntp.org' without placing undue load
on any of the primary timeservers
> if ntpd is not currently running, you could do the following
>
> /usr/sbin/ntpdate pool.ntp.org
> hwclock --systohc
These two lines by themselves seem almost perfect.
But I have been trained<g> to check the exit status
of calls. So my script reads:
(start)--------------------------
# This short script follows advice from Richard Rognlie, 25 Aug 08
val=1 # Start off with val a "wrong" value
TIMESERVER="pool.ntp.org" # this URL will give me "some" timeserver!
/usr/sbin/ntpdate $TIMESERVER
val=$?
# val should now be 0 if ntpdate executed correctly
# echo "val is now $val" Debugging!
if [ $val -eq 0 ]; then
hwclock --systohc
else
echo "Call to ntpdate failed."
fi
------------------------(finish)
(and now actually my call to hwclock fails on my etch machine!)
Anyway, my thanks to Richard, and to Jesse Becker, for their
replies and helpful aid.
Alan
--
Alan McConnell : http://patriot.net/users/alan
There are many good Impeachment sites; one of the best is:
www.waifllc.org
More information about the Dclug
mailing list