This commit is contained in:
Dave Eddy 2015-11-21 23:40:22 -05:00
parent 4a9fc6dc52
commit 76b6c1fe10
1 changed files with 2 additions and 3 deletions

View File

@ -9,7 +9,7 @@
usage() {
local prog=${0##*/}
cat <<-EOF
usage: zfs-prune-snapshots [-hnv] [-p <prefix] <time> [[dataset1] ...]
usage: $prog [-hnv] [-p <prefix] <time> [[dataset1] ...]
remove snapshots from one or more zpools that match given criteria
@ -132,12 +132,11 @@ shift
pools=("$@")
now=$(date +%s)
cutoff=$((now - seconds))
code=0
while read -r snapshot creation; do
# ensure optional prefix matches
snapname=${snapshot#*@}
if [[ -n $prefix && $prefix != ${snapname:0:${#prefix}} ]]; then
if [[ -n $prefix && $prefix != "${snapname:0:${#prefix}}" ]]; then
debug "skipping $snapshot: doesn't match prefix $prefix"
continue
fi