Skip to content

Instantly share code, notes, and snippets.

@geraldurbas
Forked from jstutters/zfs_cleanup.sh
Last active October 15, 2024 22:40
Show Gist options
  • Save geraldurbas/7eb970e599eeca123c903783fd1b8615 to your computer and use it in GitHub Desktop.
Save geraldurbas/7eb970e599eeca123c903783fd1b8615 to your computer and use it in GitHub Desktop.
Find and delete multiple ZFS snapshots
zfs list -t snapshot -H -o name | grep "201509[0-9].*" | xargs -n1 echo
# zfs list -t snapshot -H -o name | grep "201509[0-9].*" | xargs -n1 zfs destroy
zfs list -r -t snapshot -o name BusinessData/Strato-varwww | grep "2024-07" | xargs -n1 echo
zfs list -r -t snapshot -o name BusinessData/Strato-varwww | grep "2024-07" | xargs -n1 zfs destroy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment