Ignore:
Timestamp:
08/16/13 07:17:14 (13 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3
Children:
1d1b425, 5fd031d
Parents:
176289d
Message:

Add "lpreserver status" command, which will show last snapshot / replication for all datasets

File:
1 edited

Legend:

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

    r0c5977f rcb8f638  
    349349  fi 
    350350} 
     351 
     352listStatus() { 
     353 
     354  for i in `grep "${PROGDIR}/backend/runsnap.sh" /etc/crontab | awk '{print $8}'` 
     355  do 
     356    echo -e "DATASET - SNAPSHOT - REPLICATION" 
     357    echo "------------------------------------------" 
     358 
     359    lastSEND=`zfs get -r backup:lpreserver ${i} | grep LATEST | awk '{$1=$1}1' OFS=" " | tail -1 | cut -d '@' -f 2 | cut -d ' ' -f 1` 
     360    lastSNAP=`zfs list -t snapshot -d 1 -H ${i} | tail -1 | awk '{$1=$1}1' OFS=" " | cut -d '@' -f 2 | cut -d ' ' -f 1` 
     361 
     362    if [ -z "$lastSEND" ] ; then lastSEND="NONE"; fi 
     363    if [ -z "$lastSNAP" ] ; then lastSNAP="NONE"; fi 
     364 
     365    echo "$i - $lastSNAP - $lastSEND" 
     366  done 
     367} 
Note: See TracChangeset for help on using the changeset viewer.