This script works quite well. I am running it with userscripts as a cron task to do ZFS snapshots.
Thankyou for your efforts with it.
Given the current way the script handles purging old snapshots based on the number of snapshots
would it be possible to purge by age.
eg. only keep snapshots less than 30 days old?
I have been looking how i may do this alteration myself and found an easy way to get the creation time. so if its not something you have considered then fingers crossed
>zfs list -t snapshot -p -o name,creation -s creation -r "${DATASET}"
Returns Snapshot Name and the creation time (as a unix timestamp)