From cc9f1802ed56852c2bf9f619308abacaab8b0ea1 Mon Sep 17 00:00:00 2001 From: Darik Horn Date: Sat, 21 Jan 2012 16:32:30 -0600 Subject: [PATCH] Fix pool exclusions. Use $ZPOOL_STATUS instead of $ZFS_STATUS for pool exclusions. A mistaken variable name made the pool exclusion logic a no-op and broke the --skip-scrub switch. Also correct a trivial comment typo. --- src/zfs-auto-snapshot.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/zfs-auto-snapshot.sh b/src/zfs-auto-snapshot.sh index 44db629..fb4c8d1 100755 --- a/src/zfs-auto-snapshot.sh +++ b/src/zfs-auto-snapshot.sh @@ -358,13 +358,13 @@ do done # Get a list of pools that are being scrubbed. -ZPOOLS_SCRUBBING=$(echo "$ZFS_STATUS" | awk -F ': ' \ +ZPOOLS_SCRUBBING=$(echo "$ZPOOL_STATUS" | awk -F ': ' \ '$1 ~ /^ *pool$/ { pool = $2 } ; \ $1 ~ /^ *scan$/ && $2 ~ /scrub in progress/ { print pool }' \ | sort ) # Get a list of pools that cannot do a snapshot. -ZPOOLS_NOTREADY=$(echo "$ZFS_STATUS" | awk -F ': ' \ +ZPOOLS_NOTREADY=$(echo "$ZPOOL_STATUS" | awk -F ': ' \ '$1 ~ /^ *pool$/ { pool = $2 } ; \ $1 ~ /^ *state$/ && $2 !~ /ONLINE|DEGRADED/ { print pool } ' \ | sort) @@ -446,7 +446,7 @@ do # Ibid regarding iii. jjj="$jj/" - # The --recusive switch only matters for non-wild arguments. + # The --recursive switch only matters for non-wild arguments. if [ -z "$opt_recursive" -a "$1" != '//' ] then # Snapshot this dataset non-recursively.