The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 09-01-2008
Annihilannic Annihilannic is offline Forum Advisor  
  
 

Join Date: May 2008
Location: Sydney, Australia
Posts: 1,009
So... you want to only run your check once an hour and see whether it has run three times?


Code:
if [[ "$(grep -Eqc ": $h:(15|30|45):.*SendToCM: run\(\)" schedulerTrace.log)" -eq 3 ]]
then
      echo job did run 3 times in the hour
else
      echo job did not run 3 times in the hour
fi

I'm assuming that there are only one day's worth of jobs in the log, otherwise of course you will match the previous day's jobs too.