Changeset 1e85620


Ignore:
Timestamp:
04/16/14 12:45:10 (12 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, releng/10.0.2, releng/10.0.3, releng/10.1, releng/10.1.1
Children:
eaea8ff
Parents:
9bc8c2a
Message:

Speed up some of the ZFS operations used when doing life-preserver
commands, don't need to get recursive lists of things when are only
looking for a top level match

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

Legend:

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

    ra3560cd r1e85620  
    7575 
    7676listZFSSnap() { 
    77   zfs list -t snapshot | grep -e "^${1}@" | awk '{print $1}' 
     77  zfs list -d 1 -t snapshot | grep -e "^${1}@" | awk '{print $1}' 
    7878} 
    7979 
    8080rmZFSSnap() { 
    81   `zfs list -t snapshot | grep -q "^$1@$2 "` || exit_err "No such snapshot!" 
     81  `zfs list -d 1 -t snapshot | grep -q "^$1@$2 "` || exit_err "No such snapshot!" 
    8282  if [ "$RECURMODE" = "ON" ] ; then 
    8383     flags="-r" 
     
    9191revertZFSSnap() { 
    9292  # Make sure this is a valid snapshot 
    93   `zfs list -t snapshot | grep -q "^$1@$2 "` || exit_err "No such snapshot!" 
     93  `zfs list -d 1 -t snapshot | grep -q "^$1@$2 "` || exit_err "No such snapshot!" 
    9494 
    9595  # Rollback the snapshot 
     
    134134 
    135135snaplist() { 
    136   zfs list -t snapshot | grep "^${1}@" | cut -d '@' -f 2 | awk '{print $1}' 
     136  zfs list -d 1 -t snapshot | grep "^${1}@" | cut -d '@' -f 2 | awk '{print $1}' 
    137137} 
    138138 
     
    300300 
    301301  # Check for the last snapshot marked as replicated already 
    302   lastSEND=`zfs get -r backup:lpreserver ${LDATA} | grep LATEST | awk '{$1=$1}1' OFS=" " | tail -1 | cut -d '@' -f 2 | cut -d ' ' -f 1` 
     302  lastSEND=`zfs get -d 1 backup:lpreserver ${LDATA} | grep LATEST | awk '{$1=$1}1' OFS=" " | tail -1 | cut -d '@' -f 2 | cut -d ' ' -f 1` 
    303303 
    304304  # Lets get the last snapshot for this dataset 
     
    390390    echo "------------------------------------------" 
    391391 
    392     lastSEND=`zfs get -r backup:lpreserver ${i} | grep LATEST | awk '{$1=$1}1' OFS=" " | tail -1 | cut -d '@' -f 2 | cut -d ' ' -f 1` 
     392    lastSEND=`zfs get -d 1 backup:lpreserver ${i} | grep LATEST | awk '{$1=$1}1' OFS=" " | tail -1 | cut -d '@' -f 2 | cut -d ' ' -f 1` 
    393393    lastSNAP=`zfs list -t snapshot -d 1 -H ${i} | tail -1 | awk '{$1=$1}1' OFS=" " | cut -d '@' -f 2 | cut -d ' ' -f 1` 
    394394 
     
    608608 
    609609  # Now lets mark none of our datasets as replicated 
    610   lastSEND=`zfs get -r backup:lpreserver ${LDATA} | grep LATEST | awk '{$1=$1}1' OFS=" " | tail -1 | cut -d '@' -f 2 | cut -d ' ' -f 1` 
     610  lastSEND=`zfs get -d 1 backup:lpreserver ${LDATA} | grep LATEST | awk '{$1=$1}1' OFS=" " | tail -1 | cut -d '@' -f 2 | cut -d ' ' -f 1` 
    611611  if [ -n "$lastSEND" ] ; then 
    612612     zfs set backup:lpreserver=' ' ${LDATA}@$lastSEND 
  • src-sh/lpreserver/backend/runsnap.sh

    rbf3df89 r1e85620  
    6565 
    6666  # 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` 
     67  lastSEND=`zfs get -d 1 backup:lpreserver ${LDATA} | grep LATEST | awk '{$1=$1}1' OFS=" " | tail -1 | cut -d '@' -f 2 | cut -d ' ' -f 1` 
    6868  if [ -n "$lastSEND" ] ; then 
    6969     sec="`echo $lastSEND | cut -d '-' -f 7`" 
Note: See TracChangeset for help on using the changeset viewer.