Skip to content

Instantly share code, notes, and snippets.

@psftw
Created July 24, 2013 03:05
Show Gist options
  • Save psftw/6067799 to your computer and use it in GitHub Desktop.
Save psftw/6067799 to your computer and use it in GitHub Desktop.
check for build jobs without sane retention policies
import os
from glob import glob
# check for build jobs without sane retention policies
data = []
for bdir in glob("jobs/*/builds"):
walkgen = os.walk(bdir)
dirpath, dirnames, filenames = walkgen.next()
data.append((len(dirnames), bdir))
data.sort()
for (cnt, bdir) in data:
if cnt > 20:
print "%4s %s" % (cnt, bdir)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment