Ignore:
Timestamp:
08/14/09 13:02:30 (15 years ago)
Author:
sdipsl
Message:
  • Add generic function to send mail
  • Only one message for now : simulation is finished
  • More to follow (simulation stop too early ...)
File:
1 edited

Legend:

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

    r145 r153  
    199199 
    200200#D-#================================================== 
     201#D-function IGCM_sys_SendMail 
     202#D-* Purpose: Send mail when simulation is over 
     203#D-* Examples: 
     204#D- 
     205function IGCM_sys_SendMail { 
     206    IGCM_debug_PushStack "IGCM_sys_SendMailPost" $@ 
     207    if ( $DEBUG_sys ) ; then 
     208        echo "IGCM_sys_SendMail :" $@ 
     209    fi 
     210 
     211    cat  << END_MAIL > job_atlas.mail 
     212Dear ${LOGIN}, 
     213 
     214  Simulation ${config_UserChoices_JobName} is finished on supercomputer `hostname`. 
     215  Job started : ${DateBegin} 
     216  Job ended   : ${DateEnd} 
     217  Ouput files are available in ${R_SAVE} 
     218END_MAIL 
     219 
     220    if [ ! -z ${config_UserChoices_MailName} ] ; then 
     221        mailx -s "${config_UserChoices_JobName} completed mail" ${config_UserChoices_MailName} <  job_end.mail 
     222    elif [ -f ~/.forward ] ; then 
     223        mailx -s "${config_UserChoices_JobName} completed forward 1" $( cat ~/.forward ) < job_end.mail 
     224    fi 
     225 
     226    if [ $? -gt 0 ] ; then 
     227        echo "IGCM_sys_SendMail : erreur." 
     228        IGCM_debug_Exit "IGCM_sys_SendMail" 
     229    fi 
     230    IGCM_debug_PopStack "IGCM_sys_SendMail" 
     231} 
     232 
     233#D-#================================================== 
    201234#D-function IGCM_sys_Mkdir 
    202235#D-* Purpose: Master locale mkdir command 
Note: See TracChangeset for help on using the changeset viewer.