LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Need to find out which job has start status but no end status (https://www.linuxquestions.org/questions/linux-general-1/need-to-find-out-which-job-has-start-status-but-no-end-status-4175445589/)

ajdba 01-14-2013 02:59 PM

Need to find out which job has start status but no end status
 
## This script Checks the log to be sure that all jobs
# that started actually finished. Each job should have a start
# and end status. If not, something happened during the execution
# we need to find out which start status doesn't have end status and display those line.

logdt=$1

typeset -i numstart
typeset -i numend
numstart=`grep :START: /usr/local/ex/logs/exec_log | grep $logdt | wc -l`
numend=`grep :END: /usr/local/ex/logs/exec_log | grep $logdt | wc -l`
echo "Number of jobs started: $numstart"
echo "Number of jobs ended: $numend"

if [[ $numstart -ne $numend ]]; then
echo "Warning, check jobs for $logdt. Number started doesn't match number ended"
fi


# Figure out how to match the start and end lines and display the ones that have the start line but no end line.
exit

Thanks

TB0ne 01-14-2013 03:35 PM

Quote:

Originally Posted by ajdba (Post 4869956)
## This script Checks the log to be sure that all jobs
# that started actually finished. Each job should have a start
# and end status. If not, something happened during the execution
# we need to find out which start status doesn't have end status and display those line.

logdt=$1

typeset -i numstart
typeset -i numend
numstart=`grep :START: /usr/local/ex/logs/exec_log | grep $logdt | wc -l`
numend=`grep :END: /usr/local/ex/logs/exec_log | grep $logdt | wc -l`
echo "Number of jobs started: $numstart"
echo "Number of jobs ended: $numend"

if [[ $numstart -ne $numend ]]; then
echo "Warning, check jobs for $logdt. Number started doesn't match number ended"
fi


# Figure out how to match the start and end lines and display the ones that have the start line but no end line.
exit

Thanks

If you're stuck, tell us where you're stuck, and post what you've tried, and we will be happy to help you.

Otherwise do your own homework. Thanks.


All times are GMT -5. The time now is 06:25 PM.