LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   cron executes job three times at the same time (https://www.linuxquestions.org/questions/linux-software-2/cron-executes-job-three-times-at-the-same-time-619361/)

rimvydazas 02-07-2008 10:13 AM

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.

rimvydazas 02-07-2008 10:44 AM

Quote:

Originally Posted by rimvydazas (Post 3049150)
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?

Lepakko 02-07-2008 02:47 PM

Sounds like you need ntpd, the Network Time Protocol daemon.


All times are GMT -5. The time now is 01:41 AM.