Ignore:
Timestamp:
04/06/11 17:16:38 (13 years ago)
Author:
sdipsl
Message:

Send mail notification when computing job stops
It could be that we send a notification if a post-processing job stops in PROD mode ---> need some refactoring and caution...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_vargas.ksh

    r434 r437  
    183183        echo "IGCM_sys_SendMail :" $@ 
    184184    fi 
    185     cat  << END_MAIL > job_end.mail 
     185 
     186    if ( ${ExitFlag} ) ; then 
     187        status=FAILED 
     188        cat  << END_MAIL > job_end.mail 
     189Dear ${LOGIN}, 
     190 
     191  Simulation ${config_UserChoices_JobName} failed on supercomputer `hostname`. 
     192  Job started : ${PeriodDateBegin} 
     193  Job ended   : ${PeriodDateEnd} 
     194  Output files are available in ${R_SAVE} 
     195  Script files, Script Outputs and Debug files are available in ${SUBMIT_DIR} 
     196END_MAIL 
     197    else 
     198        status=COMPLETED 
     199        cat  << END_MAIL > job_end.mail 
    186200Dear ${LOGIN}, 
    187201 
     
    192206  Script files and Script Outputs are available in ${SUBMIT_DIR} 
    193207END_MAIL 
     208    fi 
    194209 
    195210    if [ ! -z ${config_UserChoices_MailName} ] ; then 
    196         mailx -s "${config_UserChoices_JobName} completed" ${config_UserChoices_MailName} <  job_end.mail 
     211        mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} <  job_end.mail 
    197212    elif [ -f ~/.forward ] ; then 
    198         mailx -s "${config_UserChoices_JobName} completed" $( cat ~/.forward ) < job_end.mail 
     213        mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail 
    199214    else 
    200         mailx -s "${config_UserChoices_JobName} completed" ${USER} < job_end.mail 
     215        mailx -s "${config_UserChoices_JobName} ${status}" ${USER} < job_end.mail 
    201216    fi 
    202217 
Note: See TracChangeset for help on using the changeset viewer.