Need to be root to destroy snapshots
authorAlan J. Pippin <alan@pippins.net>
Fri, 20 Aug 2021 22:03:56 +0000 (16:03 -0600)
committerAlan J. Pippin <ajp@pippins.net>
Fri, 20 Aug 2021 22:03:56 +0000 (16:03 -0600)
Change-Id: I59d7cc59785b99219af3bdf1163461e738ee1d9c

zfs-rm-all-snaps

index 868bba53dae88f376b18660cb81e71d2165a1a73..5bc06096b25dad491ff1eafe262ea61fc8d1f99b 100755 (executable)
@@ -29,7 +29,7 @@ read
 
 for snap in `zfs list -t snapshot 2>/dev/null | grep "^$zfs_pool" | grep "$snap_pattern" | awk '{print $1}'`; do
   echo "   destroying snapshot: $snap"
-  zfs destroy "$snap" 2>/dev/null
+  sudo zfs destroy "$snap" 2>/dev/null
 done
 
 echo "-> Snapshots removed"