Operating System - HP-UX
1820592 Members
1853 Online
109626 Solutions
New Discussion юеВ

How to tell how many cron jobs are in the queue

 
SOLVED
Go to solution
James Brand
Frequent Advisor

How to tell how many cron jobs are in the queue

We'd like to monitor the number of cron jobs in the queue but don't know how to check.

We recently had a problem when a script that runs every few minutes failed to complete and filled up the queue. The script has logic to make sure this won't happen but apparently didn't work. That's being fixed but we'd also like to set up a Tivoli alert.

Does anyone know how to check the number of cron entries in the queue? (I've already changed /var/adm/cron/queuedefs)

Thanks,
Jim
4 REPLIES 4
skt_skt
Honored Contributor
Solution

Re: How to tell how many cron jobs are in the queue

"ps -ef|grep pidofcron" will show u the currently asscoaited cron jobs

Also u may put some thing similar condition in script

cat /var/adm/cron/log|tail -100|grep "MAXRUN" >/dev/null 2>&1
if [ $? -eq 0 ]
then
echo "PLease check cron jobs"
fi
Aussan
Respected Contributor

Re: How to tell how many cron jobs are in the queue

you also might want to look at queuedefs
it's the queue description file for at, batch, and crontab.

The tongue weighs practically nothing, but so few people can hold it
harry d brown jr
Honored Contributor

Re: How to tell how many cron jobs are in the queue

at -l
and
crontab -l

??

Maybe you could monitor the size of /var/adm/cron/FIFO?

live free or die
harry
Live Free or Die
James Brand
Frequent Advisor

Re: How to tell how many cron jobs are in the queue

I'll write a script to grep for number of cron processes running.

Thanks!