Jonathan Adams via illumos-zfs
2014-05-14 08:54:08 UTC
I've posted this to the OpenIndiana-discuss list, and they suggested that I
pass it on to you.
--
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.
--
All the suggestions involved either "zfs list -t snapshot > tempfile"
followed greps and tails, or "zfs list -H -d 1 -o name -S creation -t
snapshot "$target" | head -n 1" equivalents.
What I'm trying to do is find out if a particular snapshot exists.
pool/slice/***@yesterdays-formatted-date ... is there any way of
quickly finding out if this exists?
Thanks in advance.
Jonathan Adams
-------------------------------------------
illumos-zfs
Archives: https://www.listbox.com/member/archive/182191/=now
RSS Feed: https://www.listbox.com/member/archive/rss/182191/23047029-187a0c8d
Modify Your Subscription: https://www.listbox.com/member/?member_id=23047029&id_secret=23047029-2e85923f
Powered by Listbox: http://www.listbox.com
pass it on to you.
--
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.
--
All the suggestions involved either "zfs list -t snapshot > tempfile"
followed greps and tails, or "zfs list -H -d 1 -o name -S creation -t
snapshot "$target" | head -n 1" equivalents.
What I'm trying to do is find out if a particular snapshot exists.
pool/slice/***@yesterdays-formatted-date ... is there any way of
quickly finding out if this exists?
Thanks in advance.
Jonathan Adams
-------------------------------------------
illumos-zfs
Archives: https://www.listbox.com/member/archive/182191/=now
RSS Feed: https://www.listbox.com/member/archive/rss/182191/23047029-187a0c8d
Modify Your Subscription: https://www.listbox.com/member/?member_id=23047029&id_secret=23047029-2e85923f
Powered by Listbox: http://www.listbox.com