Skip to content

Commit e126876

Browse files
author
Jonathan Carter
authored
Merge pull request #85 from riyad/fix-recursive-snapshots-with-noauto-descendants
Fix recursive snapshots for datasets with noauto descendants
2 parents 1ae1adc + e93096c commit e126876

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/zfs-auto-snapshot.sh

100755100644
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,11 +440,16 @@ do
440440
# Just testing "$ii" != ${ii#$jj} would incorrectly match.
441441
iii="$ii/"
442442

443-
# Exclude datasets that are not named on the command line.
443+
# Exclude datasets
444+
# * that are not named on the command line or
445+
# * those whose prefix is not on the command line (if --recursive flag is set)
444446
IN_ARGS='0'
445447
for jj in "$@"
446448
do
447449
if [ "$jj" = '//' -o "$jj" = "$ii" ]
450+
then
451+
IN_ARGS=$(( $IN_ARGS + 1 ))
452+
elif [ -n "$opt_recursive" -a "$iii" != "${iii#$jj}" ]
448453
then
449454
IN_ARGS=$(( $IN_ARGS + 1 ))
450455
fi

0 commit comments

Comments
 (0)