jenkins: clean unused workspaces jenkins: clean unused workspaces jenkins jenkins

jenkins: clean unused workspaces


Find out what's on the disk

Find your jenkins home

in Manage Jenkins -> Configure System,

you can see your Home Directory of your jenkins server, say $JENKINS_HOME

Have a look

ssh in to your jenkins server,

du -s $JENKINS_HOME/workspace/* | sort -nrk 1

and you should have a list of most disk consuming projects, in decending order.

Find out what's in use

get a document describing your online jobs from jenkins REST service:

http://your.ci-server.com/api/json?tree=jobs[name]

your.ci-server.com would be your jenkins server name.

you will get somthing like

{"jobs":[{"name":"a"},{"name":"b"}]}

All you have to do now is to compare these two lists to find out the wanted jobs.