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

    r136 r153  
    173173 
    174174#D-#================================================== 
     175#D-function IGCM_sys_SendMail 
     176#D-* Purpose: Send mail when simulation is over 
     177#D-* Examples: 
     178#D- 
     179function IGCM_sys_SendMail { 
     180    IGCM_debug_PushStack "IGCM_sys_SendMailPost" $@ 
     181    if ( $DEBUG_sys ) ; then 
     182        echo "IGCM_sys_SendMail :" $@ 
     183    fi 
     184 
     185    cat  << END_MAIL > job_atlas.mail 
     186Dear ${LOGIN}, 
     187 
     188  Simulation ${config_UserChoices_JobName} is finished on supercomputer `hostname`. 
     189  Job started : ${DateBegin} 
     190  Job ended   : ${DateEnd} 
     191  Ouput files are available in ${R_SAVE} 
     192END_MAIL 
     193 
     194    if [ ! -z ${config_UserChoices_MailName} ] ; then 
     195        mailx -s "${config_UserChoices_JobName} completed mail" ${config_UserChoices_MailName} <  job_end.mail 
     196    elif [ -f ~/.forward ] ; then 
     197        mailx -s "${config_UserChoices_JobName} completed forward 1" $( cat ~/.forward ) < job_end.mail 
     198    fi 
     199 
     200    if [ $? -gt 0 ] ; then 
     201        echo "IGCM_sys_SendMail : erreur." 
     202        IGCM_debug_Exit "IGCM_sys_SendMail" 
     203    fi 
     204    IGCM_debug_PopStack "IGCM_sys_SendMail" 
     205} 
     206 
     207#D-#================================================== 
    175208#D-function IGCM_sys_Mkdir 
    176209#D-* Purpose: Master locale mkdir command 
Note: See TracChangeset for help on using the changeset viewer.