Deleting ZFS Snapshots

If you are in the situation to deal with many zfs snapshots that are not needed anymore you can try this. !!! USE AT YOUR OWN RISK !!!

#!/bin/bash
for snapshot in `zfs list -H -t snapshot | cut -f 1` #add grep's here to limit
                                                     #the amount of deletes
do
zfs destroy $snapshot
done
zfs list -H -t snapshot
Tags: zfs linux freebsd