Skip to content

Commit

Permalink
Fix pool exclusions.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dajhorn committed Jan 21, 2012
1 parent d77af5a commit cc9f180
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/zfs-auto-snapshot.sh
Expand Up @@ -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)
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit cc9f180

Please sign in to comment.