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.
This commit is contained in:
Darik Horn 2012-01-21 16:32:30 -06:00
parent d77af5a902
commit cc9f1802ed

View File

@ -358,13 +358,13 @@ do
done done
# Get a list of pools that are being scrubbed. # 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 ~ /^ *pool$/ { pool = $2 } ; \
$1 ~ /^ *scan$/ && $2 ~ /scrub in progress/ { print pool }' \ $1 ~ /^ *scan$/ && $2 ~ /scrub in progress/ { print pool }' \
| sort ) | sort )
# Get a list of pools that cannot do a snapshot. # 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 ~ /^ *pool$/ { pool = $2 } ; \
$1 ~ /^ *state$/ && $2 !~ /ONLINE|DEGRADED/ { print pool } ' \ $1 ~ /^ *state$/ && $2 !~ /ONLINE|DEGRADED/ { print pool } ' \
| sort) | sort)
@ -446,7 +446,7 @@ do
# Ibid regarding iii. # Ibid regarding iii.
jjj="$jj/" 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" != '//' ] if [ -z "$opt_recursive" -a "$1" != '//' ]
then then
# Snapshot this dataset non-recursively. # Snapshot this dataset non-recursively.