LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 01-14-2013, 02:59 PM   #1
ajdba
LQ Newbie
 
Registered: Jan 2013
Posts: 1

Rep: Reputation: Disabled
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
 
Old 01-14-2013, 03:35 PM   #2
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 13,787

Rep: Reputation: 2349Reputation: 2349Reputation: 2349Reputation: 2349Reputation: 2349Reputation: 2349Reputation: 2349Reputation: 2349Reputation: 2349Reputation: 2349Reputation: 2349
Quote:
Originally Posted by ajdba View Post
## 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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
cupsd fails when trying to create a printer with status code 127 and at times status 2 lgoldma Linux - Software 0 11-02-2012 07:52 PM
Server Hung due to hda: status timeout: status=0xd0 { Busy } adamalic Linux - Enterprise 3 12-15-2011 01:27 PM
hdc: status timeout: status=0xd0 { Busy } bagra Linux - Newbie 6 06-12-2009 01:15 PM
Installing RedHat 8.0 onto Dell PowerEdge SC1425 - hdc: status error: status = 0x58 fishsponge Linux - General 0 07-11-2006 09:02 AM
cron job status - how to ? mofo Linux - Software 0 12-14-2004 06:56 PM


All times are GMT -5. The time now is 11:24 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration