Created
July 2, 2014 20:07
-
-
Save RLovelett/7060cec3d3fd14018326 to your computer and use it in GitHub Desktop.
Delete ZFS snapshots from dataset one-liner
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
zfs list -r -H -t snapshot -o name stream/lxc/stash | xargs -n1 zfs destroy |
zfs destroy -rvn dataset_or_zvol_name@%
remove -n to actually run.
just be careful that this doesn't handle well with datasets that has space in their names
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I like that one (to be selective, I have 3 pools on my pc):
zfs list -r -H -t snapshot -o name | grep <poolname/whatever> | xargs -n1 zfs destroy