[OpenIndiana-discuss] Finding the "last" snapshot for a zfs volume

Discussion list for OpenIndiana openindiana-discuss at openindiana.org
Mon May 12 11:48:47 UTC 2014


Most of my systems I do "zfs list -t snapshot > file" then grep that file of each of the filesystems I am interested in.

John

-----Original Message-----
From: Discussion list for OpenIndiana [mailto:openindiana-discuss at openindiana.org] 
Sent: 12 May 2014 12:20
To: Discussion list for OpenIndiana
Subject: [OpenIndiana-discuss] Finding the "last" snapshot for a zfs volume

On our backup servers I have a "backup-check" script that checks to see what the last snapshot for a particular volume is (and compares it with the current date)

df -F zfs -h |grep $mypool | nawk '{system("zfs list -t snapshot -r "$1" \| tail -1")}' | egrep -v "$yesterday|no datasets"

okay, it's messy, but it should find the last snapshot for each zfs slice within a pool.

However with the number of pools on the server increasing, and the number of snapshots getting bigger every day, I was wondering if there is an easier way of getting the latest snapshot than "zfs list -t snapshot -r pool/snapshot | tail -1"

Any ideas would be helpful.

Jon
_______________________________________________
OpenIndiana-discuss mailing list
OpenIndiana-discuss at openindiana.org
http://openindiana.org/mailman/listinfo/openindiana-discuss

_______________________________________________________________________

The contents of this e-mail and any attachment(s) are strictly confidential and are solely for the person(s) at the e-mail address(es) above. If you are not an addressee, you may not disclose, distribute, copy or use this e-mail, and we request that you send an e-mail to admin at stirling-dynamics.com and delete this e-mail.  Stirling Dynamics Ltd. accepts no legal liability for the contents of this e-mail including any errors, interception or interference, as internet communications are not secure.  Any views or opinions presented are solely those of the author and do not necessarily represent those of Stirling Dynamics Ltd. Registered In England No. 2092114 Registered Office: 26 Regent Street, Clifton, Bristol. BS8 4HG
VAT no. GB 464 6551 29
_______________________________________________________________________

This e-mail has been scanned for all viruses MessageLabs.



More information about the openindiana-discuss mailing list