Printer FriendlyEmail Article Link

How can I see the cronjobs that are running and filling up the queue on a unix host?

Answer

 

How can I see the cronjobs that are running and filling up the queue on a unix host?
 
1)      Log in
2)      issue: ps –eaf | grep –i cron
3)      using the pid found in the previous step, issue: ps –eaf | grep <pid>
4)      The listing will show all the scripts still running that were kicked off by crontab. 
 
Note, to learn the max number of simultaneous cronjobs that can run, issue:
cat /var/adm/cron/queuedefs
 
Example
ps of the cron pid when nothing is happening:
=> ps -eaf | grep -i cron
    root 3014848       1   0   Jan 15      -  4:44 /usr/sbin/cron
 
ps of the cron pid when STCLive PM retire scripts kick off:
=> ps -eaf | grep -i 3014848
root 3014848       1   1   Jan 15      -  4:44 /usr/sbin/cron
smartsys  590124 3014848   0 12:35:00      -    0:00 /usr/bin/ksh /spirent/metro/escout/scripts/wrapper.sh /spirent/cots/perl/5.6.1/bin/perl /spirent/metro/escout/scripts/escout_data_retire.pl
 
At this point only 1 cronjob script is running -- the default is 100 simultaneous running cronjob scripts.
To see the scripts  the retire scripts call and are running (but these don't count towards the 100 above)
 
=> ps -eaf | grep -i retire
smartsys 6029444 7143806  10 12:35:52      -  0:00 /spirent/cots/perl/5.6.1/bin/perl -w /spirent/metro/escout/scripts/jdbcaccess.sh -p scripts/jdbcaccessProperties.txt /spirent/metro/escout/scripts/../tmp/qscope_retire_data_296_delete_rows.sql
 
smartsys 6422536 2884028   0 12:35:52      -  0:00 /spirent/cots/perl/5.6.1/bin/perl /spirent/metro/escout/scripts/escout_data_retire.pl
 
smartsys  590124 3014848   0 12:35:00      -  0:00 /usr/bin/ksh /spirent/metro/escout/scripts/wrapper.sh /spirent/cots/perl/5.6.1/bin/perl /spirent/metro/escout/scripts/escout_data_retire.pl smartsys 2884028  590124   1 12:35:00      -  0:00 /spirent/cots/perl/5.6.1/bin/perl /spirent/metro/escout/scripts/escout_data_retire.pl
 
smartsys 3539216 6422536  10 12:35:52      -  0:00 /spirent/cots/perl/5.6.1/bin/perl -w /spirent/metro/escout/scripts/jdbcaccess.sh -p scripts/jdbcaccessProperties.txt /spirent/metro/escout/scripts/../tmp/qscope_retire_data_300_delete_rows.sql
smartsys 6029568 8520166  10 12:35:52      -  0:00 /spirent/cots/perl/5.6.1/bin/perl -w /spirent/metro/escout/scripts/jdbcaccess.sh -p scripts/jdbcaccessProperties.txt /spirent/metro/escout/scripts/../tmp/qscope_retire_data_294_delete_rows.sql
 
smartsys 7143806 2884028   0 12:35:52      -  0:00 /spirent/cots/perl/5.6.1/bin/perl /spirent/metro/escout/scripts/escout_data_retire.pl
 
smartsys 8520166 2884028   0 12:35:52      -  0:00 /spirent/cots/perl/5.6.1/bin/perl /spirent/metro/escout/scripts/escout_data_retire.pl
 
cat /var/adm/cron/queuedefs
If everything is commented out, the defaults are used.
 
# @(#)91        1.3 src/bos/usr/sbin/cron/queuedefs, cmdcntl, bos610 4/25/91 17:17:19
# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
# bos610 src/bos/usr/sbin/cron/queuedefs 1.3
# Licensed Materials - Property of IBM
# COPYRIGHT International Business Machines Corp. 1989,1991
# All Rights Reserved
# US Government Users Restricted Rights - Use, duplication or
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
# IBM_PROLOG_END_TAG
#
# COMPONENT_NAME: (CMDCNTL) commands needed for basic system needs
#
# FUNCTIONS:
#
# ORIGINS: 27, 18
#
# (C) COPYRIGHT International Business Machines Corp. 1989,1991
# All Rights Reserved
# Licensed Materials - Property of IBM
#
# US Government Users Restricted Rights - Use, duplication or
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
#
# cron values for each queue of batch jobs:
#
#       queue.xxjxxnxxw
#
# queues:
# a - sh jobs          d - sync event
# b - batch jobs       e - ksh jobs
# c - cron event       f - csh jobs
#
xxj - maximum number of jobs in this queue (deafault 100)
# xxn - nice value at which these jobs will run at (default 2)
# xxw - wait time till next execution attempt (default 60 seconds)
#
#
# here is an example of a low prority (nice 20), 50 entry batch queue
# b.50j20n60w
 
 

Product : VW Controller PM Classic,VW Controller T&D Classic,DSLDB,TEST PORTAL,TINT,HCLI,GRANITE,HDI,UNIX,REACT