From d92fcdd6fc927a5badbc44f016ef8e831d9fbbf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marc=20W=C3=A4ckerlin?= Date: Mon, 9 Oct 2017 11:18:26 +0200 Subject: [PATCH] enable delete --- btrfs-snapshots.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/btrfs-snapshots.sh b/btrfs-snapshots.sh index 2a592b6..92bd672 100755 --- a/btrfs-snapshots.sh +++ b/btrfs-snapshots.sh @@ -117,11 +117,11 @@ for fs in ${BTRFS_VOLUMES}; do echo " " umount "$TMP_MNT" else sudo btrfs subvolume snapshot "${TMP_MNT}${subvol}" "${TMP_MNT}${target}${date}" - #if test -n "$del"; then - # for f in $(ls -d1 "${TMP_MNT}${target}"-* | sort -r | tail -n +"$del"); do - # sudo btrfs subvolume delete "$f" - # done - #fi + if test -n "$del"; then + for f in $(ls -d1 "${TMP_MNT}${target}"-* | sort -r | tail -n +"$del"); do + sudo btrfs subvolume delete "$f" + done + fi fi sudo umount "$TMP_MNT" else