From: Alan J. Pippin Date: Fri, 29 Jan 2010 17:25:34 +0000 (-0700) Subject: Merge branch 'master' of ssh://backup.pippins.net/etc/bin/zfs/ X-Git-Url: http://git.pippins.net/embedvideo/.git/static/gitweb.js?a=commitdiff_plain;h=ff5bbb17fd4d48fd78cec13ea762cebdead567ff;hp=c322e317ccd7550337a622436db8e1e9bb48214c;p=zfs-nexenta%2F.git Merge branch 'master' of ssh://backup.pippins.net/etc/bin/zfs/ Conflicts: zfs-replicate --- diff --git a/zfs-autosnap-wrapper b/zfs-autosnap-wrapper index ab09272..fc17c08 100755 --- a/zfs-autosnap-wrapper +++ b/zfs-autosnap-wrapper @@ -15,6 +15,9 @@ numsnapshots=20 maxagedays=365 date=`date` mylockdir="/tmp/zfs-autosnap-all" +current_hour=`date +"%H"` +current_minute=`date +"%M"` +current_day=`date +"%u"` # Make sure we aren't already running if ! mkdir "$mylockdir" >/dev/null 2>&1; then @@ -26,20 +29,22 @@ fi date >> $logfile # Special filesystems -zfs-autosnap storage /storage $numsnapshots 15 -zfs-autosnap tank/usr/videos /usr/videos $numsnapshots 15 +# ex: zfs-autosnap storage /storage $numsnapshots 15 +# ex: zfs-autosnap tank/usr/videos /usr/videos $numsnapshots 15 # Normal filesystems -zfs-autosnap tank / $numsnapshots $maxagedays -zfs-autosnap tank/home /home $numsnapshots $maxagedays +# ex: zfs-autosnap tank / $numsnapshots $maxagedays +# ex: zfs-autosnap tank/home /home $numsnapshots $maxagedays # Daily filesystems (only perform these at midnight) -if [ `date +"%H:%M"` == "00:00" ]; then +# midnight = true if (midnight < current time < midnight+5 min) +if [[ $current_hour == "00" && $current_minute -lt 5 ]]; then echo "Performing Daily snapshots" >> $logfile fi # Weekly filesystems (only perform these on Sunday at midnight) -if [ `date +"%H:%M:%u"` == "00:00:7" ]; then +# midnight = true if (midnight < current time < midnight+5 min) +if [[ $current_day == "7" && $current_hour == "00" && $current_minute -lt 5 ]]; then echo "Performing Weekly snapshots" >> $logfile fi diff --git a/zfs-log-parser b/zfs-log-parser index 94e4490..f13c2a0 100755 --- a/zfs-log-parser +++ b/zfs-log-parser @@ -117,7 +117,7 @@ sub parse_snapshot_totals_logfile { elsif(($in_totals == 1) && ($line =~ /(\S+)\s+([\d\.]*)(\w+)\s+(\d+)/)) { $filesystem = $1; $data = $2; $size = $3; $num_snaps = $4; if($filesystem =~ /Snapshots/ || $filesystem =~ /Total/) { next; } - if($filesystem =~ /$backup_pool/) { next; } + if($filesystem =~ /^$backup_pool/) { next; } if(length($filesystem) > $maxlen) { $maxlen = length($filesystem); } if($size =~ /K/i) { $data = $data * $kilo; } if($size =~ /M/i) { $data = $data * $mega; } diff --git a/zfs-scripts.conf.dist b/zfs-scripts.conf.dist index b6c3a7d..956e697 100644 --- a/zfs-scripts.conf.dist +++ b/zfs-scripts.conf.dist @@ -41,7 +41,7 @@ maxruntime=0 # Setup throttling related parameters that will rate limit the zfs send | zfs receive pipe throttle_enable=0 -throttle_opt="-M 5" +throttle_opt="-v -M 1" throttle=/usr/local/bin/throttle # Specify the list of filesystems to replicate from the remote to the local_pool (1 per line)