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_iitm.ksh

    r428 r437  
    201201        echo "IGCM_sys_SendMail :" $@ 
    202202    fi 
    203     cat  << END_MAIL > job_end.mail 
     203 
     204    if ( ${ExitFlag} ) ; then 
     205        status=FAILED 
     206        cat  << END_MAIL > job_end.mail 
     207Dear ${LOGIN}, 
     208 
     209  Simulation ${config_UserChoices_JobName} failed on supercomputer `hostname`. 
     210  Job started : ${PeriodDateBegin} 
     211  Job ended   : ${PeriodDateEnd} 
     212  Output files are available in ${R_SAVE} 
     213  Script files, Script Outputs and Debug files are available in ${SUBMIT_DIR} 
     214END_MAIL 
     215    else 
     216        status=COMPLETED 
     217        cat  << END_MAIL > job_end.mail 
    204218Dear ${LOGIN}, 
    205219 
     
    210224  Script files and Script Outputs are available in ${SUBMIT_DIR} 
    211225END_MAIL 
     226    fi 
    212227 
    213228    if [ ! -z ${config_UserChoices_MailName} ] ; then 
    214         mailx -s "${config_UserChoices_JobName} completed" ${config_UserChoices_MailName} <  job_end.mail 
     229        mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} <  job_end.mail 
    215230    elif [ -f ~/.forward ] ; then 
    216         mailx -s "${config_UserChoices_JobName} completed" $( cat ~/.forward ) < job_end.mail 
     231        mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail 
    217232    else 
    218         mailx -s "${config_UserChoices_JobName} completed" ${USER} < job_end.mail 
     233        mailx -s "${config_UserChoices_JobName} ${status}" ${USER} < job_end.mail 
    219234    fi 
    220235 
Note: See TracChangeset for help on using the changeset viewer.