[TriLUG] DATE problems

Paul D. Boyle boyle at laue.chem.ncsu.edu
Mon Dec 17 13:19:50 EST 2001


Roy Vestal wrote:
> I have a question on the date program. Everyday, I login and have to run
> date -s hh:mm:ss am/pm to set the clock. I have run this as root via su when
> logged in as me, as well as log in as root, but everyday I have to do this.
> Any one know what to look for, or am I doing this wrong?

I don't understand why you "have to run" this whenever you login.
Does your system clock get really far off in between logins, or does
the loss of time control seem related to the act of logging in?

I have my Linux boxes set their clocks to the NCSU (my employer) local
time server using 'rdate' (I don't need super precise timings) when they
are rebooted (I modified the /etc/rc.d/rc.local script).

Here is the relevant part of the script:

if [ -f /usr/bin/rdate ]
then
      /usr/bin/rdate -s time.ncsu.edu
fi


I also set up a cron job to run every night which does this:
#!/bin/bash
#Set the person to mail the message to.
ADMIN_MAIL=some_user
if ! /usr/bin/rdate -s time.ncsu.edu
 then
   echo "rdate failed with nonzero exit" | \
         mail -s "Failed System Time" $ADMIN_MAIL
fi


I don't know if 'rdate' is included in the more recent RedHat distributions.

Paul

-- 
Paul D. Boyle			    |	boyle at laue.chem.ncsu.edu
Director, X-ray Structural Facility |	phone: (919) 515-7362
Department of Chemistry - Box 8204  |	FAX:   (919) 515-5079
North Carolina State University     | 
Raleigh, NC, 27695-8204
http://laue.chem.ncsu.edu/web/xray.welcome.html



More information about the TriLUG mailing list