Changeset 00c51cb


Ignore:
Timestamp:
Aug 8, 2013 12:17:54 PM (8 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1
Children:
33f5a6d
Parents:
47af458
Message:

Update reporting of snapshots to have Success / FAILED in e-mail subject

Fix up file locations of properties on remote side

Location:
src-sh/lpreserver/backend
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src-sh/lpreserver/backend/functions.sh

    r47af458 r00c51cb  
    320320 
    321321  # Lets start by building a list of props to keep 
    322   rProp=".lp-repset`echo ${REPRDATA} | sed 's|/|#|g'`" 
     322  rProp=".lp-props-`echo ${REPRDATA} | sed 's|/|#|g'`" 
    323323 
    324324  zfs get -r all $DATASET | grep ' local$' | awk '{$1=$1}1' OFS=" " | sed 's| local$||g' \ 
  • src-sh/lpreserver/backend/runsnap.sh

    rfeb0fb0 r00c51cb  
    1212DATASET="${1}" 
    1313KEEP="${2}" 
     14snapStat=0 
    1415 
    1516if [ -z "${DATASET}" ]; then 
     
    2223if [ $? -ne 0 ] ; then 
    2324  echo_log "ERROR: Failed creating snapshot on ${DATASET}" 
    24   email_msg "Snapshot ERROR" "ERROR: Failed creating snapshot on ${DATASET} @ `date`\n\r`cat $CMDLOG`" 
     25  queue_msg "Snapshot ERROR" "ERROR: Failed creating snapshot on ${DATASET} @ `date`\n\r`cat $CMDLOG`" 
     26  snapStat=1 
    2527else 
    2628  queue_msg "Success creating snapshot on ${DATASET} @ `date`\n\r`cat $CMDLOG`" 
     
    5355      if [ $? -ne 0 ] ; then 
    5456        echo_log "ERROR: Failed pruning snapshot $snap on ${DATASET}" 
    55         email_msg "Snapshot ERROR" "ERROR: Failed pruning snapshot $snap on ${DATASET} @ `date`\n\r`cat $CMDLOG`" 
     57        queue_msg "Snapshot ERROR" "ERROR: Failed pruning snapshot $snap on ${DATASET} @ `date`\n\r`cat $CMDLOG`" 
     58        snapStat=1 
    5659      else 
    5760        queue_msg "Success pruning snapshot $snap on ${DATASET} @ `date`\n\r`cat $CMDLOG`" 
     
    6063done 
    6164 
    62 if [ "$EMAILMODE" = "ALL" ] ; then 
    63    email_msg "Automated Snapshot" "`echo_queue_msg`" 
     65# If we failed at any point, sent out a notice 
     66if [ $snapStat -ne 0 ] ; then 
     67   email_msg "Automated Snapshot - FAILED" "`echo_queue_msg`" 
     68fi 
     69 
     70# If we are successful and user wants all notifications, send out a message 
     71if [ $snapStat -eq 0 -a "$EMAILMODE" = "ALL" ] ; then 
     72   email_msg "Automated Snapshot - Success" "`echo_queue_msg`" 
    6473fi 
    6574 
Note: See TracChangeset for help on using the changeset viewer.