ProLiant Servers (ML,DL,SL)
1819796 Members
3075 Online
109607 Solutions
New Discussion

Cron jobs being "skipped"

 
Ayman Altounji
Valued Contributor

Cron jobs being "skipped"

I'm having trouble with cron skipping jobs on a Compaq Proliant 3000 with SCO 5.0.6. I have batch jobs that run under cron at night. Some nights, cron will kick off all the batch jobs. Some nights, it will kick off some of them. Some nights, it will kick off none of them. Sometimes it will kick the jobs off but anywhere from 5 to 20 minutes after they are supposed to run. At ALL times the cron daemon is running - it is not a problem with the daemon "dying". If I kill the FIFO file, then kill and restart cron using the "sd" command, it will fix the problem temporarily. Log files have been no help and nothing is being mailed to the root account. Has anyone else run into this problem? If so, were you able to find a fix?
1 REPLY 1
Ayman Altounji
Valued Contributor

Re: Cron jobs being "skipped"

A bit of work, but:
put each of the cron jobs into a different shell script, where it is launched
as a background process. Place a statement before and after your command that
logs the time. ie, if you wanted to run "doit" from cron, then write doit.sh as:

# A debug wrapper
echo "starting the job" >>/tmp/doit.log
date >>/tmp/doit.log

doit &

echo "Command was launched "" >>/tmp/doit.log
date >>/tmp/doit.log

...

Cron seems to be single threaded, so one job acting up causes problems. Check
the logs afterwards and you may see a job that does not launch, or a long
time gap between to jobs that should run at the same time.

Good luck