<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
 
 </head><body style="">
 
  <div>
   <br />> On 23 January 2014 at 14:22 Dave Morley <davmor2@davmor2.co.uk> wrote:
   <br />> 
   <br />> 
   <br />> It is subprocess.check_output that checks the result of running a
   <br />> command so nicely and reads it back into python :) dir(subprocess) help
   <br />> me find it and then help(subprocess.check_output) gave me how to use it
   <br />> :) As I say gotta love python :)
   <br />> -- 
   <br />> You make it, I'll break it!
   <br />> 
   <br />> I love my job :)
   <br />> http://www.ubuntu.com
   <br />> http://www.canonical.com
   <br />> 
  </div> 
  <div>
    
  </div> 
  <div>
   Yep, that's the one I was using:
  </div> 
  <div>
    
  </div> 
  <div>
   # Get a list of existing snapshots using zfs list
   <br /># All snapshots starting with data/db are potentially eligible for culling
   <br />print "Enumerating snapshots..."
   <br />cull_list=[ (s.split()[0],mkdate(s.split()[0])) for s in
   <br />                    subprocess.check_output(["zfs", "list", "-r", "-t", "snapshot", ]).splitlines()
   <br />                        if s.startswith("data/db") ]
   <br />
   <br />
  </div> 
  <div>
   :D andydj
  </div>
 
</body></html>