From 4058de70adb7a51069f037c98949d0309841edb6 Mon Sep 17 00:00:00 2001 From: Austcool-Walker <61804916+Austcool-Walker@users.noreply.github.com> Date: Fri, 30 Oct 2020 22:40:22 -0400 Subject: [PATCH] Update zap-snapshots.sh --- payloads/zap-snapshots.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/payloads/zap-snapshots.sh b/payloads/zap-snapshots.sh index 695b300..87fb268 100755 --- a/payloads/zap-snapshots.sh +++ b/payloads/zap-snapshots.sh @@ -33,8 +33,14 @@ then fi fi -for XID in `diskutil apfs listSnapshots "$VOLUME"|fgrep XID|awk '{print $3}'` +#Snapshot deletion code by StarPlayrX 2020 +snapshots=$(diskutil apfs listsnapshots "$VOLUME" | grep +-- | sed 's/^.\{4\}//') + +for uuid in $snapshots do - echo $XID - diskutil apfs deleteSnapshot "$VOLUME" -xid $XID + printf '📸 Attempting to delete snapshot => ' + echo $uuid + echo '' + + diskutil apfs deletesnapshot "$VOLUME" -uuid $uuid done