| Author |
Message |
Susan *nix forums beginner
Joined: 25 Oct 2005
Posts: 20
|
Posted: Thu Jul 13, 2006 6:47 am Post subject:
ntpdate and cron
|
|
|
Hi,
I'd like to run ntpdate periodic, for example every 6 hours.
Is it possible to add ntpdate to the crontab.
If so is there an example available.
If i'am completely lost, please give me some advice.
Thanks in advance,
Robertico |
|
| Back to top |
|
 |
patpro ~ Patrick Proniews *nix forums addict
Joined: 02 Mar 2005
Posts: 56
|
Posted: Thu Jul 13, 2006 7:51 am Post subject:
Re: ntpdate and cron
|
|
|
In article <e94qcb$vvc$1@localhost.localdomain>,
"Susan" <Susan@nospam.notvalid> wrote:
| Quote: | Hi,
I'd like to run ntpdate periodic, for example every 6 hours.
Is it possible to add ntpdate to the crontab.
If so is there an example available.
If i'am completely lost, please give me some advice.
|
0 */6 * * * /usr/sbin/ntpdate -u ntp.apple.com
If I'm right, this should trigger ntpdate every 6 hours. change
ntp.apple.com for your nearest ntpd server.
patpro
--
http://www.patpro.net/ |
|
| Back to top |
|
 |
Bill Vermillion *nix forums Guru Wannabe
Joined: 22 Feb 2005
Posts: 298
|
Posted: Thu Jul 13, 2006 10:45 am Post subject:
Re: ntpdate and cron
|
|
|
In article <patpro-C12A47.09515113072006@localhost>,
patpro ~ Patrick Proniewski <patpro@boleskine.patpro.net> wrote:
| Quote: | In article <e94qcb$vvc$1@localhost.localdomain>,
"Susan" <Susan@nospam.notvalid> wrote:
Hi,
I'd like to run ntpdate periodic, for example every 6 hours.
Is it possible to add ntpdate to the crontab.
If so is there an example available.
If i'am completely lost, please give me some advice.
0 */6 * * * /usr/sbin/ntpdate -u ntp.apple.com
If I'm right, this should trigger ntpdate every 6 hours. change
ntp.apple.com for your nearest ntpd server.
|
I typically use north-American.pool.ntp.org
If you just use pool.ntp.org you also get non NA sites.
http://www.ntp.org is a good reference/tutorial site.
Bill
--
Bill Vermillion - bv @ wjv . com |
|
| Back to top |
|
 |
Robertico *nix forums beginner
Joined: 02 Apr 2005
Posts: 38
|
Posted: Fri Jul 14, 2006 12:44 pm Post subject:
Re: ntpdate and cron
|
|
|
|
Thank ! |
|
| Back to top |
|
 |
Christopher Nehren *nix forums Guru Wannabe
Joined: 27 Apr 2005
Posts: 262
|
Posted: Sat Jul 15, 2006 11:27 pm Post subject:
Re: ntpdate and cron
|
|
|
On 2006-07-13, Susan scribbled these
curious markings:
| Quote: | Hi,
I'd like to run ntpdate periodic, for example every 6 hours.
Is it possible to add ntpdate to the crontab.
If so is there an example available.
If i'am completely lost, please give me some advice.
|
Better than spawning a new process every six hours and cluttering up
your crontab, why don't you run ntpd, which is specifically designed for
this purpose, and is more robust besides? While you're at it, might I
suggest the net/openntpd port? It's far simpler to configure. Just put
your IP address into /usr/local/etc/ntpd.conf if you only want to listen
on one interface, enable it in /etc/rc.conf and then start it.
Note, also, that the Handbook section on NTP (25.10, which you should
have read before coming here, BTW) mentions that cron itself requires an
accurate clock to function correctly. If you're correcting the clock in
a process run from cron, which itself needs an accurate clock, doesn't
that seem like a chicken and egg problem to you? :)
Best Regards,
Christopher Nehren |
|
| Back to top |
|
 |
Bill Vermillion *nix forums Guru Wannabe
Joined: 22 Feb 2005
Posts: 298
|
Posted: Sun Jul 16, 2006 1:55 am Post subject:
Re: ntpdate and cron
|
|
|
In article <vReug.262849$lC7.161412@fe01.news.easynews.com>,
Christopher Nehren <apeiron+usenet@coitusmentis.info> wrote:
| Quote: | On 2006-07-13, Susan scribbled these
curious markings:
Hi,
I'd like to run ntpdate periodic, for example every 6 hours.
Is it possible to add ntpdate to the crontab.
If so is there an example available.
If i'am completely lost, please give me some advice.
Better than spawning a new process every six hours and cluttering
up your crontab, why don't you run ntpd, which is specifically
designed for this purpose, and is more robust besides? While
you're at it, might I suggest the net/openntpd port? It's
far simpler to configure. Just put your IP address into
/usr/local/etc/ntpd.conf if you only want to listen on one
interface, enable it in /etc/rc.conf and then start it.
|
What do you mean by 'cluttering up your crontab'.
It's only ONE line - not several.
Here is mine, that runs hourly.
17 0-23 * * * /usr/sbin/ntpdate north-America.pool.ntp.org >/dev/null
If you only want to do it every 6 hours, then you would change
it to read:
17 0-23/6 * * * /usr/sbin/ntpdate north-America.pool.ntp.org >/dev/null
That runs once every 6 hours. No crontab clutter I can see.
Docs are in man 5 crontab
And I agree that the ntpd is probably the best way to go, but I
just wanted to show that you don't clutter the crontab by running
many times during a day.
Bill
--
Bill Vermillion - bv @ wjv . com |
|
| Back to top |
|
 |
patpro ~ Patrick Proniews *nix forums addict
Joined: 02 Mar 2005
Posts: 56
|
Posted: Sun Jul 16, 2006 10:12 am Post subject:
Re: ntpdate and cron
|
|
|
In article <vReug.262849$lC7.161412@fe01.news.easynews.com>,
Christopher Nehren <apeiron+usenet@coitusmentis.info> wrote:
| Quote: | On 2006-07-13, Susan scribbled these
curious markings:
Hi,
I'd like to run ntpdate periodic, for example every 6 hours.
Is it possible to add ntpdate to the crontab.
If so is there an example available.
If i'am completely lost, please give me some advice.
Better than spawning a new process every six hours and cluttering up
your crontab, why don't you run ntpd, which is specifically designed for
this purpose [...]
|
as far as I can say, openntpd is a far better alternative (see ports).
patpro
--
http://www.patpro.net/ |
|
| Back to top |
|
 |
Christopher Nehren *nix forums Guru Wannabe
Joined: 27 Apr 2005
Posts: 262
|
Posted: Thu Jul 20, 2006 12:11 am Post subject:
Re: ntpdate and cron
|
|
|
On 2006-07-16, patpro ~ patrick proniewski scribbled these
curious markings:
| Quote: | Better than spawning a new process every six hours and cluttering up
your crontab, why don't you run ntpd, which is specifically designed for
this purpose [...]
as far as I can say, openntpd is a far better alternative (see ports).
|
.... which I said, as you'd see if you didn't so thoroughly butcher my
post.
Best Regards,
Christopher Nehren |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|