Hi, 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? Niki Kovacs
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 -- Matt Hyclak Department of Mathematics Department of Social Work Ohio University (740) 593-1263 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: <http://lists.centos.org/pipermail/centos/attachments/20071109/e13c8b54/attachment.sig>
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. > > MattIn 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
Brian Mathis wrote:> On Nov 9, 2007 9:03 AM, Matt Hyclak <hyclak at math.ohiou.edu> wrote: > > > > 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 > > You can set the servers you want to use in /etc/ntp.confAnd check here for some publicly available time server pools: http://support.ntp.org/bin/view/Servers/NTPPoolServers -- Bowie
Niki Kovacs wrote:> > Hi, > > 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?Choose a couple publically available time servers, I believe a link was posted on this thread, and set them in /etc/ntp.conf. I suppose with 'hwclock -w' that your bios clock is set to localtime and your system dual boots? If that is the case then set UTC=false in /etc/sysconfig/clock. -Ross ______________________________________________________________________ This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender and permanently delete the original and any copy or printout thereof.
Matt Hyclak a ?crit :> 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. >Hmmm. This is strange. When I use the method you described, the command 'date' returns 17:34. But when I stop the ntpd service and run 'ntpdate' manually as I described, it's 16:34 (which is right, and btw, I live in South France). I'm confused. Niki Kovacs