Skip to content

Instantly share code, notes, and snippets.

@grzegorznowak
Created February 12, 2020 08:45
Show Gist options
  • Save grzegorznowak/446a3e58960d10e3a07b631a0c39d319 to your computer and use it in GitHub Desktop.
Save grzegorznowak/446a3e58960d10e3a07b631a0c39d319 to your computer and use it in GitHub Desktop.
Remove all the syncoid created snapshots. Uses specific syncoid's pattern, so make sure you it doesn't clash with anything else you use
#!/bin/bash
ARR=($(zfs list -t snapshot -o name -s name | grep -i -o ".*@syncoid_build.*"))
for i in "${ARR[@]}"
do
echo "Getting rid of snapshot $i..."
echo "zfs destroy -R $i"
zfs destroy -R "$i"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment