Skip to content

Commit 06527cb

Browse files
Austin WalkerAustin Walker
authored andcommitted
Updated
1 parent 2ca8bd8 commit 06527cb

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

payloads/zap-snapshots.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,14 @@ then
3333
fi
3434
fi
3535

36-
for XID in `diskutil apfs listSnapshots "$VOLUME"|fgrep XID|awk '{print $3}'`
36+
#Snapshot deletion code by StarPlayrX 2020
37+
snapshots=$(diskutil apfs listsnapshots "$VOLUME" | grep +-- | sed 's/^.\{4\}//')
38+
39+
for uuid in $snapshots
3740
do
38-
echo $XID
39-
diskutil apfs deleteSnapshot "$VOLUME" -xid $XID
41+
printf '📸 Attempting to delete snapshot => '
42+
echo $uuid
43+
echo ''
44+
45+
diskutil apfs deletesnapshot "$VOLUME" -uuid $uuid
4046
done

0 commit comments

Comments
 (0)