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

    r434 r437  
    236236    fi 
    237237 
    238     cat  << END_MAIL > job_end.mail 
     238    if ( ${ExitFlag} ) ; then 
     239        status=FAILED 
     240        cat  << END_MAIL > job_end.mail 
     241Dear ${LOGIN}, 
     242 
     243  Simulation ${config_UserChoices_JobName} failed on supercomputer `hostname`. 
     244  Job started : ${PeriodDateBegin} 
     245  Job ended   : ${PeriodDateEnd} 
     246  Output files are available in ${R_SAVE} 
     247  Script files, Script Outputs and Debug files are available in ${SUBMIT_DIR} 
     248END_MAIL 
     249    else 
     250        status=COMPLETED 
     251        cat  << END_MAIL > job_end.mail 
    239252Dear ${LOGIN}, 
    240253 
     
    245258  Script files and Script Outputs are available in ${SUBMIT_DIR} 
    246259END_MAIL 
     260    fi 
    247261 
    248262    if  [ X"${config_UserChoices_MailName}" != X ] ; then 
    249        mailx -s "${config_UserChoices_JobName} completed" ${config_UserChoices_MailName} <  job_end.mail 
     263       mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} <  job_end.mail 
    250264    elif [ -f ~/.forward ] ; then 
    251        mailx -s "${config_UserChoices_JobName} completed" $( cat ~/.forward ) < job_end.mail 
     265       mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail 
    252266    else 
    253        mailx -s "${config_UserChoices_JobName} completed" ${LOGIN} < job_end.mail 
     267       mailx -s "${config_UserChoices_JobName} ${status}" ${LOGIN} < job_end.mail 
    254268    fi 
    255269 
Note: See TracChangeset for help on using the changeset viewer.