Skip to content

Commit 3689b2c

Browse files
author
Jonathan Carter
authored
Merge pull request #91 from schors/master
Fix recursive snapshots
2 parents d27bbfa + 6ee4553 commit 3689b2c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/zfs-auto-snapshot.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,11 +464,19 @@ do
464464
iii="$ii/"
465465

466466

467-
# Exclude datasets that are not named on the command line.
467+
# Exclude datasets
468+
# * that are not named on the command line or
469+
# * those whose prefix is not on the command line (if --recursive flag is set)
468470
IN_ARGS='0'
469471
for jj in "$@"
470472
do
473+
# Ibid regarding iii.
474+
jjj="$jj/"
475+
471476
if [ "$jj" = '//' -o "$jj" = "$ii" ]
477+
then
478+
IN_ARGS=$(( $IN_ARGS + 1 ))
479+
elif [ -n "$opt_recursive" -a "$iii" != "${iii#$jjj}" ]
472480
then
473481
IN_ARGS=$(( $IN_ARGS + 1 ))
474482
fi

0 commit comments

Comments
 (0)