Created
September 28, 2010 20:58
-
-
Save RamaRoberts/601761 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
for pool in `zpool list -H -o name`; do | |
zfs snapshot -r $pool@auto:`date "+%FT%T"` | |
zfs list -H -t snapshot -o name | grep $name@auto: | \ | |
sed -e 's/.*auto://' | sort -r | uniq | tail +14 | \ | |
while read name; do | |
zfs destroy -r $pool@auto:$name | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment