diff --git a/zfs-replicate.sh b/zfs-replicate.sh index 994bda8..e35d122 100755 --- a/zfs-replicate.sh +++ b/zfs-replicate.sh @@ -151,9 +151,14 @@ snapSend() { checkLock "$TMPDIR/.replicate.send.lock" ## create initial send command based on arguments ## if first snap name is not empty generate an incremental - local args="-R" - if [ -n "$base" ]; then + if [ ${RECURSE_CHILDREN} -eq 1 ]; then + args="-R" + elif [ ${RECURSE_CHILDREN} -eq 0 ]; then + args="" + elif [ -n "$base" ] && [ ${RECURSE_CHILDREN} -eq 1 ]; then args="-R -I $base" + elif [ -n "$base" ] && [ ${RECURSE_CHILDREN} -eq 0 ]; then + args="-I $base" fi ## set the command prefix based on source host local prefix