Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save CroneKorkN/5532b8c9171491aa19997c692d961959 to your computer and use it in GitHub Desktop.
Save CroneKorkN/5532b8c9171491aa19997c692d961959 to your computer and use it in GitHub Desktop.
TYPE=hourly
if [[ "$TYPE" != "" ]]; then
for i in $(zfs list -t snapshot | grep @zfs-auto-snap_$TYPE | cut -f1 -d" "); do
echo "delete $(zfs list -t snapshot | grep @zfs-auto-snap_$TYPE | wc -l) snapshots?"; read
echo $i; zfs destroy $i
done
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment