[OpenIndiana-discuss] How to let find 'see' .zfs directories
peter.tribble at gmail.com
Thu Mar 20 13:25:51 UTC 2014
On Thu, Mar 20, 2014 at 3:02 AM, Harry Putnam <reader at newsguy.com> wrote:
> Probably some obvious thing going on here but I'm not see how find all
> '.zfs' directories under a zfs system hierarchy.
That's really the same as the list of filesystems, so
zfs list -t filesystem -r tank/foo
> Just running something like
> cd /rmh/ (that is 'p2/rmh' in zpool talk)
> find . -type d -name 'snapshot'
That's a really bad idea. What if there are a billion files under
there, could take a while. That sort of logic also gets easily
confused by anybody who can create directory names that
match your pattern.
> No hits whatsoever, when I know there are 4-5 under there.
> I wanted to setup some homeboy snapshot destroys on the basis of mving
> to all .zfs/snapshot directories and using ls -t, sed, zfs snapshot
> destroy to
> get rid of snaps beyond the most recent 8 in the directory
> So is something like 'zfs -H -t snapshot -o name' the only way to
> ferret out actual addresses of the snaps?
> I'd sooner use basic oldschool unix tools if possible
The zfs command exists and provides its output for a reason -
it's the most efficient and reliable source of that information, so
best take advantage of it.
http://www.petertribble.co.uk/ - http://ptribble.blogspot.com/
More information about the OpenIndiana-discuss