[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Sheflug] Re: Daylight saving time & rdate
>
> Anyone know what line to put into /etc/ppp/ip-up to sort things out ?
> Chris came up with one some time ago that works fine with Red Hat but
> won't work with my system.
In ip-up I put this in:
# Set date/time via NTP, then write back to CMOS
(
/usr/sbin/netdate tcp ntp2a.mcc.ac.uk tcp ntp2b.mcc.ac.uk tcp
ntp2c.mcc.ac.uk tcp ntp2d.mcc.ac.uk tcp ntp.cs.strath.ac.uk
/sbin/clock -wu
) | logger -p local2.info -t netdate &
Note the netdate line is one line if it looks like two. In /etc/rc.d/boot
(SuSE 6.2 -- so YMMV dependant on dist/version) there is a line that does
"hwclock -s $GMT" where GMT is set in /etc/rc.config and on my system is
set to "-u".
Also bear in mind, SuSE doesn't ship with rdate - it uses netdate.
Conversely redhat doesn't have netdate, but uses rdate.
hwclock (or /sbin/clock) -s does set system time, -w does write back to
CMOS and -u is a flag to say CMOS clock is set to UTC (aka GMT). If you
set with -su and write back with -w, you'll start doing the timewarp, and
will find yourself taking a jump to the left (and a step to the
side...put your hands on hips and bend your knees in time ... etc
etc)...you'll also find your CMOS clock will get reet confused. Same if
you set with -s and write with -wu.
If you use -u for write, use it for set, and vice versa. If you don't use
-u for set, don't use it for write and vice versa...
>
> Other thing is. Once my net facing box has updated itself I then need
> to get my workstation to check in on that box so that it will correct
> itself. Perhaps crontab could be used ?
>
> */30 * * * /check/time/every/30/mins
>
> although wot the crontab might look like I've no idea ?
>
Depends how often you want to set the clock :) It's only really worth
setting it as often as is needed. A box witha good internal clock sync
say twice a day....if it's a bit worse, once an hour. For hourly I'd use:
0 * * * * netdate <serverlist>
though I'd probably end up throwing thte command into a small script (say
get-time) and sticking it in /usr/local/bin...it'd look pretty much like
the stuff above.
For 30 mins:
0,30 * * * * /usr/local/bin/get-time
Change the minutes invocation to as needed - I rarely run stuff on the
hour as if I did that I'd have lots of things all trying to start at once
on some boxes I've touched - better to stagger jobs so the machine gets a
vageuly constant load, say 20mins and 50mins past if you want a 30min
sync time.
Chris...
--
Chris Johnson \ "If not for me then, do it for yourself. If
not
sixie@nccnet.co.uk \ for then do it for the world." -- Stevie
Nicks
www.nccnet.co.uk/~sixie/ ~---------------------------------------+
Redclaw chat - http://redclaw.org.uk - telnet redclaw.org.uk 2000
\______
---------------------------------------------------------------------
Sheffield Linux User's Group - http://www.sheflug.co.uk
To unsubscribe from this list send mail to
- <sheflug-request [at] vuw.ac.nz> - with the word
"unsubscribe" in the body of the message.
GNU the choice of a complete generation.