[CentOS] System on time

Fri Nov 9 14:17:46 UTC 2007
Brian Mathis <brian.mathis at gmail.com>

On Nov 9, 2007 9:03 AM, Matt Hyclak <hyclak at math.ohiou.edu> wrote:
> On Fri, Nov 09, 2007 at 03:00:10PM +0100, Niki Kovacs enlightened us:
> > To get my system on time, I usually issue these two commands:
> >
> > # ntpdate de.pool.ntp.org
> > # hwclock -w
> >
> > And when I want this to be done on startup, I put the two lines in
> > rc.local.
> >
> > I wonder if this is an orthodox way to do things. Or is there something
> > more appropriate?
> >
>
> chkconfig ntpd on
> will cause ntpd to sync and start the ntp daemon every boot.
> service ntpd start
> will start the daemon right now.
>
> Matt

In addition, it's often tempting to put 'ntpdate' in a cron job and
run it every so often.  This is a bad idea however, because ntpdate
will forcefully update the clock to the time as it is right now, while
ntpd will speed up or slow down the clock, to a point, to make sure
that all seconds are ticked.  This allows any job that relies on the
time to run, even if the clock is fast or slow.  Using the ntpdate
method could easily cause cron jobs not to run, depending on how far
off your clock is when it's run.

You can set the servers you want to use in /etc/ntp.conf