Merge pull request #85 from riyad/fix-recursive-snapshots-with-noauto-descendants

Fix recursive snapshots for datasets with noauto descendants
This commit is contained in:
Jonathan Carter 2018-04-17 13:33:38 +02:00 committed by GitHub
commit e1268767b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

7
src/zfs-auto-snapshot.sh Executable file → Normal file
View File

@ -440,11 +440,16 @@ do
# Just testing "$ii" != ${ii#$jj} would incorrectly match.
iii="$ii/"
# Exclude datasets that are not named on the command line.
# Exclude datasets
# * that are not named on the command line or
# * those whose prefix is not on the command line (if --recursive flag is set)
IN_ARGS='0'
for jj in "$@"
do
if [ "$jj" = '//' -o "$jj" = "$ii" ]
then
IN_ARGS=$(( $IN_ARGS + 1 ))
elif [ -n "$opt_recursive" -a "$iii" != "${iii#$jj}" ]
then
IN_ARGS=$(( $IN_ARGS + 1 ))
fi