From c0667adce9a0915a3cd5982dad37db9e54dae62c Mon Sep 17 00:00:00 2001 From: Tamas Gerczei Date: Wed, 30 Aug 2017 15:36:41 +0200 Subject: [PATCH] simplified snapuse() by removing recursion and related arithmetics --- zfs-backup.sh | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/zfs-backup.sh b/zfs-backup.sh index 7ceabce..d79a07b 100644 --- a/zfs-backup.sh +++ b/zfs-backup.sh @@ -16,18 +16,7 @@ function check_dataset() { } function snapuse() { - # whee - local TOTAL=0 - while read value - do - if [[ $value =~ ^[0-9] ]] - then - TOTAL=$(( $TOTAL + $value )) - fi - done \ - <<< "$(${R_RMOD} /usr/sbin/zfs get -Hpro value usedbysnapshots ${1} 2>/dev/null)" - - echo $TOTAL + ${R_RMOD} /usr/sbin/zfs get -Hpo value usedbysnapshots ${1} } function human() {