Hi Guys , sorry for my first post but a newbie here need some help on my simple scripts.
I have some scripts below that count the job started and the job finished
and is the job started and job finished equal ..then all job was successfully run and
finished on that day.
but sometime the was started ..and for some reason it restarted again
and my job finished and job started were not equal that day.
On this case.. I want an output which Job was not been finished on that day.
so far the scripts only gave me a comparison between job been started and finished.
any good idea how I can do this? thanks in advance.
[im sorry dont know what will be the appropriate title for this]
Log Files
2012/02/16 00:35:18 Job : Activity Started : Job123
2012/02/16 00:37:16 Job : Activity Started : Job125
2012/02/16 00:38:12 Job : Activity Started : Job126
2012/02/16 00:40:11 Job : Activity Started : Job127
2012/02/16 00:45:21 Job : Activity Started : Job123
2012/02/16 01:07:26 Job : Activity Finished : Job125
2012/02/16 01:08:42 Job : Activity Finished : Job126
2012/02/16 01:15:51 Job : Activity Finished : Job127
notice the Job123 did not finished on this log
Script
#!/bin/ksh
JobLog=/Log/server.log
STARTCount=`grep "Job : Activity Started:" ${JobLog} | wc -1`
ENDCount=`grep "Job : Activity Finished:" ${JobLog} | wc -1`
if [[ ${STARTCount} != ${ENDCount} ]] ; then
echo "Job NOT Completed..Start:${STARTCount} End:${ENDCount}" >> /Log/unsuccessfull.log
else
echo "Job has been Completed" >> /Log/successfull.log
fi