From 04a532ef76765e522e24bd74efd54caf3d89b892 Mon Sep 17 00:00:00 2001 From: simono41 Date: Sat, 18 Aug 2018 16:30:44 +0200 Subject: [PATCH] snapshot_delete --- snapshot.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/snapshot.sh b/snapshot.sh index 28d9c43..c070530 100755 --- a/snapshot.sh +++ b/snapshot.sh @@ -97,6 +97,21 @@ elif [ "restore" == "$1" ]; then #reboot +elif [ "delete" == "$1" ]; then + + while (( "$(expr $# - 1)" )) + do + pfad="${2}" + + if btrfs subvolume delete /run/btrfs-root/__snapshot/${pfad}\@* ;then + echo "${pfad} erfolgreich gelöscht!!!" + else + echo "${pfad} konnte nicht gefunden werden!!!" + fi + + shift + done + else echo "bash ./snapshot.sh PARAMETER PFAD" @@ -107,3 +122,5 @@ else btrfs subvolume list -p / fi + +echo "Fertig !!!"