Changeset 042dc70


Ignore:
Timestamp:
02/27/14 06:21:58 (5 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, releng/10.0.1, releng/10.0.2
Children:
4f9718b
Parents:
97252e15
Message:

Improve listing of ZFS snapshots in life-preserver, also fix a bug with replication,
don't auto-prune the last replicated snapshot, so that zfs send/recv are happy

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

Legend:

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

    r9cd0fa0 r042dc70  
    7575 
    7676listZFSSnap() { 
    77   zfs list -t snapshot | grep -e "^NAME" -e "^${1}@" 
     77  zfs list -t snapshot | grep -e "^${1}@" | awk '{print $1}' 
    7878} 
    7979 
  • src-sh/lpreserver/backend/runsnap.sh

    r167bbaa r042dc70  
    6464  done 
    6565 
     66  # Get the last replicated snapshot 
     67  lastSEND=`zfs get -r backup:lpreserver ${LDATA} | grep LATEST | awk '{$1=$1}1' OFS=" " | tail -1 | cut -d '@' -f 2 | cut -d ' ' -f 1` 
     68 
    6669  num=0 
    6770  for snap in $rSnaps 
     
    7073     cur="`echo $snap | cut -d '-' -f 1`" 
    7174     if [ "$cur" != "auto" ] ; then continue; fi 
     75 
     76     # If this snapshot is the last one replicated, lets skip pruning it for now 
     77     if [ "$cur" = "$lastSEND" ]; then continue; fi 
    7278 
    7379     sec="`echo $snap | cut -d '-' -f 7`" 
Note: See TracChangeset for help on using the changeset viewer.