[Wolves] Andy as per our discussion last night

andy at wild-flower.co.uk andy at wild-flower.co.uk
Thu Jan 23 14:34:53 UTC 2014


> On 23 January 2014 at 14:22 Dave Morley <davmor2 at davmor2.co.uk> wrote:
>
>
> It is subprocess.check_output that checks the result of running a
> command so nicely and reads it back into python :) dir(subprocess) help
> me find it and then help(subprocess.check_output) gave me how to use it
> :) As I say gotta love python :)
> --
> You make it, I'll break it!
>
> I love my job :)
> http://www.ubuntu.com
> http://www.canonical.com
>

Yep, that's the one I was using:

# Get a list of existing snapshots using zfs list
# All snapshots starting with data/db are potentially eligible for culling
print "Enumerating snapshots..."
cull_list=[ (s.split()[0],mkdate(s.split()[0])) for s in
                    subprocess.check_output(["zfs", "list", "-r", "-t",
"snapshot", ]).splitlines()
                        if s.startswith("data/db") ]

:D andydj
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.lug.org.uk/pipermail/wolves/attachments/20140123/58cefe11/attachment.html>


More information about the Wolves mailing list