Changeset cd05890


Ignore:
Timestamp:
05/15/14 06:23:23 (12 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, releng/10.0.2, releng/10.0.3, releng/10.1, releng/10.1.1, releng/10.1.2
Children:
9d5cf20
Parents:
48434f8
Message:

Fix some bugs auto-pruning old BE's

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-sh/libsh/functions.sh

    r8482df7 rcd05890  
    665665  # TODO 
    666666  snapList=`beadm list | grep ^beforeUpdate | awk '{print $1}'` 
    667   snapCount=`echo $snapList | wc -l | awk '{print $1}'` 
     667  snapCount=`beadm list | grep ^beforeUpdate | awk '{print $1}' | wc -l | awk '{print $1}'` 
    668668 
    669669  if [ -z "$snapCount" ] ; then return ; fi 
     
    682682  for snap in $rSnaps 
    683683  do 
    684      cur="`echo $snap | cut -d '-' -f 1`" 
    685      if [ "$cur" != "beforeUpdate" ] ; then continue; fi 
    686  
    687684     num=`expr $num + 1` 
    688  
    689685     # Make sure this BE isn't mounted or running 
    690      beadm list grep "^$snap " | grep -q -e " N " -e " NR "  -e " /" 
     686     beadm list | grep "^$snap " | grep -q -e " N " -e " NR "  -e " /" 
    691687     if [ $? -eq 0 ] ; then continue ; fi 
    692688 
    693689     if [ $num -gt $KEEP ] ; then 
    694690        # Remove this old BE 
    695         echo "Removing BE: $snap" 
    696         beadm destroy $snap >/dev/null 2>/dev/null 
     691        echo "Removing Boot Environment: $snap" 
     692        beadm destroy -F $snap >/dev/null 2>/dev/null 
    697693     fi 
    698694  done 
Note: See TracChangeset for help on using the changeset viewer.