niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
· nixdoc.net · man pages · Linux HOWTOs · FreeBSD Tips · Forums
navigation Forum index » *nix » BSD » FreeBSD
ntpdate and cron
Post new topic   Reply to topic Page 1 of 1 [8 Posts] View previous topic :: View next topic
Author Message
Christopher Nehren
*nix forums Guru Wannabe


Joined: 27 Apr 2005
Posts: 262

PostPosted: Thu Jul 20, 2006 12:11 am    Post subject: Re: ntpdate and cron Reply with quote

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
patpro ~ Patrick Proniews
*nix forums addict


Joined: 02 Mar 2005
Posts: 56

PostPosted: Sun Jul 16, 2006 10:12 am    Post subject: Re: ntpdate and cron Reply with quote

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
Bill Vermillion
*nix forums Guru Wannabe


Joined: 22 Feb 2005
Posts: 298

PostPosted: Sun Jul 16, 2006 1:55 am    Post subject: Re: ntpdate and cron Reply with quote

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
Christopher Nehren
*nix forums Guru Wannabe


Joined: 27 Apr 2005
Posts: 262

PostPosted: Sat Jul 15, 2006 11:27 pm    Post subject: Re: ntpdate and cron Reply with quote

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
Robertico
*nix forums beginner


Joined: 02 Apr 2005
Posts: 38

PostPosted: Fri Jul 14, 2006 12:44 pm    Post subject: Re: ntpdate and cron Reply with quote

Thank !
Back to top
Bill Vermillion
*nix forums Guru Wannabe


Joined: 22 Feb 2005
Posts: 298

PostPosted: Thu Jul 13, 2006 10:45 am    Post subject: Re: ntpdate and cron Reply with quote

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
patpro ~ Patrick Proniews
*nix forums addict


Joined: 02 Mar 2005
Posts: 56

PostPosted: Thu Jul 13, 2006 7:51 am    Post subject: Re: ntpdate and cron Reply with quote

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
Susan
*nix forums beginner


Joined: 25 Oct 2005
Posts: 20

PostPosted: Thu Jul 13, 2006 6:47 am    Post subject: ntpdate and cron Reply with 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.

Thanks in advance,

Robertico
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [8 Posts] View previous topic :: View next topic
The time now is Wed Mar 10, 2010 9:02 am | All times are GMT
navigation Forum index » *nix » BSD » FreeBSD
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Cron job connect AIX 11 Thu Jul 13, 2006 1:36 am
No new posts Separate user timezones for cron, possible? Tim Jones AIX 4 Thu Jul 06, 2006 8:16 am
No new posts Cron : Step Values dawaves@gmail.com AIX 3 Mon Jul 03, 2006 10:56 pm
No new posts Cron Logs Mag Gam AIX 5 Mon Jul 03, 2006 12:29 pm
No new posts Cygwin problem with cron and networked drives ambroze@comcast.net networking 5 Wed Jun 28, 2006 2:54 pm

Copyright © 2004-2005 DeniX Solutions SRL   Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum |  Privacy Policy



Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0786s ][ Queries: 18 (0.0440s) ][ GZIP on - Debug on ]