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

    r145 r153  
    215215 
    216216#D-#================================================== 
     217#D-function IGCM_sys_SendMail 
     218#D-* Purpose: Send mail when simulation is over 
     219#D-* Examples: 
     220#D- 
     221function IGCM_sys_SendMail { 
     222    IGCM_debug_PushStack "IGCM_sys_SendMailPost" $@ 
     223    if ( $DEBUG_sys ) ; then 
     224        echo "IGCM_sys_SendMail :" $@ 
     225    fi 
     226 
     227    cat  << END_MAIL > job_atlas.mail 
     228Dear ${LOGIN}, 
     229 
     230  Simulation ${config_UserChoices_JobName} is finished on supercomputer `hostname`. 
     231  Job started : ${DateBegin} 
     232  Job ended   : ${DateEnd} 
     233  Ouput files are available in ${R_SAVE} 
     234END_MAIL 
     235 
     236    if [ ! -z ${config_UserChoices_MailName} ] ; then 
     237        mailx -s "${config_UserChoices_JobName} completed mail" ${config_UserChoices_MailName} <  job_end.mail 
     238    elif [ -f ~/.forward ] ; then 
     239        mailx -s "${config_UserChoices_JobName} completed forward 1" $( cat ~/.forward ) < job_end.mail 
     240    fi 
     241 
     242    if [ $? -gt 0 ] ; then 
     243        echo "IGCM_sys_SendMail : erreur." 
     244        IGCM_debug_Exit "IGCM_sys_SendMail" 
     245    fi 
     246    IGCM_debug_PopStack "IGCM_sys_SendMail" 
     247} 
     248 
     249#D-#================================================== 
    217250#D-function IGCM_sys_Mkdir 
    218251#D-* Purpose: Master locale mkdir command 
Note: See TracChangeset for help on using the changeset viewer.