Changeset ca25b67


Ignore:
Timestamp:
07/30/13 15:33:12 (12 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2
Children:
d515a9e, 4f9718b
Parents:
835dab4e
Message:

Add the placeholder for our ZFS monitor

Add some additional logging messages if a snapshot create / prune fails

Location:
src-sh/lpreserver
Files:
1 added
3 edited

Legend:

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

    r66d2766 rca25b67  
    3636  fi 
    3737 
    38  
    3938} 
    4039setOpts 
     
    5554  zdate=`date +%Y-%m-%d-%H-%M-%S` 
    5655  zfs snapshot $flags ${1}@$2${zdate} 
     56  return $? 
    5757} 
    5858 
     
    103103} 
    104104 
     105enable_watcher() 
     106{ 
     107   cronscript="${PROGDIR}/backend/zfsmon.sh" 
     108 
     109   # Check if the zfs monitor is already enabled 
     110   grep -q " $cronscript" /etc/crontab 
     111   if [ $? -eq 0 ] ; then return; fi 
     112 
     113   cLine="*/30    *       *       *       *" 
     114 
     115   echo -e "$cLine\troot    ${cronscript}" >> /etc/crontab 
     116} 
     117 
    105118snaplist() { 
    106119  zfs list -t snapshot | grep "^${1}@" | cut -d '@' -f 2 | awk '{print $1}' 
  • src-sh/lpreserver/backend/runsnap.sh

    r66d2766 rca25b67  
    2020echo_log "Creating snapshot on ${DATASET}" 
    2121mkZFSSnap "${DATASET}" "auto-" 
     22if [ $? -ne 0 ] ; then 
     23  echo_log "ERROR: Failed creating snapshot on ${DATASET}" 
     24fi 
    2225 
    2326# Get our list of snaps 
     
    4548      echo_log "Pruning old snapshot: $snap" 
    4649      rmZFSSnap "${DATASET}" "$snap" 
     50      if [ $? -ne 0 ] ; then 
     51        echo_log "ERROR: Failed pruning snapshot $snap on ${DATASET}" 
     52      fi 
    4753   fi 
    4854done 
  • src-sh/lpreserver/lpreserver

    r583ccad rca25b67  
    218218" 
    219219}; 
     220 
     221# Check if we need to enable the zfs monitor 
     222enable_watcher 
    220223 
    221224# Check what the user wants to do 
Note: See TracChangeset for help on using the changeset viewer.