Hi Joe,

I use this script to delete my empty snapshots :

#!/bin/bash

NOW=$(date +%Y%m%d-%H%M%S)

POOL=tank

zfs snapshot -r [EMAIL PROTECTED]

FS_WITH_SNAPSHOTS=$(zfs list -t snapshot | grep '@' | cut -d '@' -f 1 | uniq)

for fs in $FS_WITH_SNAPSHOTS ; do

        EMPTY_SNAPSHOTS=$(zfs list -t snapshot | grep -v "@$NOW" |
grep "${fs}@" | awk ' $2 == "0" { print $1 }' )

        for snapshot in $EMPTY_SNAPSHOTS ; do
                echo "Destroying empty snapshot $snapshot"
                zfs destroy $snapshot
        done
done

Hope that helps,

Sylvain




On Thu, Jul 17, 2008 at 7:16 AM, Joe S <[EMAIL PROTECTED]> wrote:
> I got overzealous with snapshot creation. Every 5 mins is a bad idea.
> Way too many.
>
> What's the easiest way to delete the empty ones?
>
> zfs list takes FOREVER
> _______________________________________________
> zfs-discuss mailing list
> zfs-discuss@opensolaris.org
> http://mail.opensolaris.org/mailman/listinfo/zfs-discuss
>
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to