1832143 Members
3147 Online
110038 Solutions
New Discussion

Problem with Cron

 
Adam Noble
Super Advisor

Problem with Cron

hi hope someone can help!

I have setup a weekly cron job to take an ignite image from one of our servers. Every week however I notice that the cron jobs are failing as It percieves there to be more than 100 jobs running. I understand this is the reason my cron job is failing I just cannot work out whats causing it (well I have an idea)

Every 15 mins on the system a job such as 10203494.u runs however I do not believe this relates to any cronjob we have in the /var/spool/cron/crontabs files. I can see these .u jobs are standard across all servers. The problem I have is that when I do a ps -ef on cron and dig down I can see loads of /usr/bin/sh processes which I believe are causing the problem and are generated by these .u jobs. Has anyone any idea why the jobs are simply not finishing and any further checks I can make.

Thanks
5 REPLIES 5
Massimo Bianchi
Honored Contributor

Re: Problem with Cron

Hi,
there is a known issue where cron does not release coorectly its jobs. all its son remain alive and flood up the kernel table.

Have you a recent patch for it ?

Also you may hit a limit for the maximum number os process per user.

What are your kernel parameters ?
HTH
Massimo

Bernhard Mueller
Honored Contributor

Re: Problem with Cron

Hello,

most likely some jobs are scheduled but do/did not end properly. Then cron may complain that the queue is full or something similar.

You can check /var/adm/cron/log to get a hint.

Other possibility would be a low value for the nproc kernel parameter.

Check with sar -v 1 1 what is listed below proc-sz (actual/maximum). In that case you should have syslog messages indicating process table full. I'd rule out that first.

Regards,
Bernhard
Khalid A. Al-Tayaran
Valued Contributor

Re: Problem with Cron


Hi,

You can see all system messsages in your system mail. type elm to read it. All cron jobs have the subject as "cron". There you'll find details for jobs and any error messages.

Please make sure you don't have your make_recovery tapes write-protected. This happes and backup is taken in this case.....
Paula J Frazer-Campbell
Honored Contributor

Re: Problem with Cron

Hi

If you have tusc installed then modify the start of these jobs which don't die to pick up its own PID and then start:-

tusc > /tmp/jobwatch.

This file can then be examined to see where it is "sticking".

If you do not have tusc then here:-


http://www.stokely.com/unix.sysadm.resources/shareware.www.html

Paula
If you can spell SysAdmin then you is one - anon
Bill Douglass
Esteemed Contributor

Re: Problem with Cron

For tusc, try


tusc -f -p -o /output/file /path/to/binary


-f will cause tusc to trace child processes
-p will print out the PID on each line
-o will send output to the designated file

tusc can be invoked with the PID or the name of a command to trace.

Youc an also attach to one of your hung jobs and see what is happening (if it is spinning, waiting on I/O, etc). Try

tusc for that.