Changeset 882


Ignore:
Timestamp:
06/10/09 14:09:57 (16 years ago)
Author:
Mathieu Morlighem
Message:

Added html report

Location:
issm/trunk/cron
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/cron/nightlyrun.sh

    r752 r882  
    6161cd ..
    6262
    63 #Figure out mailing list
    64 source cron/mailinglist
    65 
    6663#Launch matlab and the nightly run script
    6764matlab -nodisplay  > ./nightly.log << EOF
     
    7067EOF
    7168
    72 #Process log for errors
    73 cat nightly.log | grep ERROR > errors1.log
    74 cat nightly.log | grep SUCCESS > errors2.log
    75 cat nightly.log | grep NIGHTLYRUNTERMINATEDCORRECTLY > check.log
    76 cat errors1.log errors2.log > errors.log
     69#Build html report
     70sh report.sh
    7771               
    78 #Mail
    79 ERRORS=`cat errors.log`
    80 CHECK=`cat check.log`
    81 
    82 #1: no result -> did not work
    83 if [ `expr length "$ERRORS"`  = "0" ]; then
    84         for i in `echo $MAILINGLIST`
    85                 do
    86                         mail -s "Nightly runs of $ISSM_RELEASE on: $host_name. Date:$today. DID NOT WORK CORRECTLY" $i < nightly.log
    87                 done
    88 else
    89 
    90 #2: nightly run stopped before the end
    91         if [ `expr length "$CHECK"`  = "0" ]; then
    92                 for i in `echo $MAILINGLIST`
    93                 do 
    94                         mail -s "Nightly runs of $ISSM_RELEASE on: $host_name. Date:$today. STOPPED BEFORE THE END" $i < errors.log
    95                 done
    96 
    97 #3: everything worked
    98         else
    99                 for i in `echo $MAILINGLIST`
    100                 do 
    101                         mail -s "Nightly runs of $ISSM_RELEASE on: $host_name. Date:$today." $i < errors.log
    102                 done
    103         fi
    104 fi
     72#send mail
     73source cron/mailinglist
     74for i in `echo $MAILINGLIST`; do
     75cat - report.html <<HERE | /usr/lib/sendmail -oi -t
     76From: morlighe@wilkes.jpl.nasa.gov
     77To: $i
     78Subject: Nightly runs of $ISSM_RELEASE on: $host_name. Date:$today.
     79Mime-Version: 1.0
     80Content-Type: text/html
     81HERE
     82done
    10583
    10684#Erase log and error logs
    107 rm -rf nightly.log errors1.log errors2.log errors.log check.log
     85#rm -rf nightly.log
    10886
    10987#Erase ice code
    110 cd ..
    111 rm -rf trunk/
     88#cd ..
     89#rm -rf trunk/
Note: See TracChangeset for help on using the changeset viewer.