LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 02-07-2008, 11:13 AM   #1
rimvydazas
Member
 
Registered: Dec 2006
Posts: 44

Rep: Reputation: 15
cron executes job three times at the same time


I have my /etc/crontab like this:
Code:
*/15 * * * *   root  test -x /usr/lib/cron/run-crons && /usr/lib/cron/run-crons >/dev/null 2>&1
*/5 * * * * root ntpdate 10.1.0.1 >/dev/null 2>&1
*/15 * * * * root /root/cdr/scripts/cdrcheck.sh
I get the output of my cdrcheck.sh to e-mail. Every 15 minutes I get three emails with cdrcheck.sh output. Does it mean that cdrcheck is executed 3 times every 15 min? and why the hell it would do that??
does it have something to do with updating time with ntpdate every 5 minutes. The thing is that system time is going ahead extremely fast so I use ntpdate to synchronize time every 5 min.
 
Old 02-07-2008, 11:44 AM   #2
rimvydazas
Member
 
Registered: Dec 2006
Posts: 44

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by rimvydazas View Post
I have my /etc/crontab like this:
Code:
*/15 * * * *   root  test -x /usr/lib/cron/run-crons && /usr/lib/cron/run-crons >/dev/null 2>&1
*/5 * * * * root ntpdate 10.1.0.1 >/dev/null 2>&1
*/15 * * * * root /root/cdr/scripts/cdrcheck.sh
I get the output of my cdrcheck.sh to e-mail. Every 15 minutes I get three emails with cdrcheck.sh output. Does it mean that cdrcheck is executed 3 times every 15 min? and why the hell it would do that??
does it have something to do with updating time with ntpdate every 5 minutes. The thing is that system time is going ahead extremely fast so I use ntpdate to synchronize time every 5 min.
I guess I answered my own question. Disabling ntpdate to run every five minutes solves the problem. However, then I have time issue. Any ideas how to fool the system while using ntpdate and executing cdrcheck only once every 15 minutes?
 
Old 02-07-2008, 03:47 PM   #3
Lepakko
Member
 
Registered: Feb 2008
Location: Mannheim, Germany
Distribution: Debian Etch
Posts: 44

Rep: Reputation: 16
Sounds like you need ntpd, the Network Time Protocol daemon.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
adding a perl script to cron.daily / cron.d to setup a cron job CrontabNewBIE Linux - Software 6 01-14-2008 09:16 AM
Cron Job: Start it Only once on specified time jCash Linux - Newbie 2 12-07-2007 08:35 PM
c program that executes during a certain amount of time jagman Programming 6 04-13-2005 10:22 AM
"permission denied" error when cron job executes jillu Linux - Newbie 11 11-02-2004 02:19 PM
Howto run a job on a fixed time with cron? Schmurff Linux - Newbie 1 04-02-2004 04:31 AM


All times are GMT -5. The time now is 12:13 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration