Skip to content

Instantly share code, notes, and snippets.

@njt1982
Last active August 29, 2015 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save njt1982/8782741 to your computer and use it in GitHub Desktop.
Save njt1982/8782741 to your computer and use it in GitHub Desktop.
List Jenkins job build count from command line
#!/bin/sh
cd /var/lib/jenkins/jobs
find . -mindepth 1 -maxdepth 1 -type d -print0 | while read -d $'\0' f; do C=`find "$f/builds/" -maxdepth 1 -type d | wc -l`; echo "${C} ${f}"; done | sort -n
@njt1982
Copy link
Author

njt1982 commented Feb 3, 2014

Useful when teamed up with http://superuser.com/questions/589528/how-do-i-delete-the-builds-11-to-1717-in-jenkins to delete jobs in a project which hasn't had log rotation enabled and has got slightly out of control.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment