Procedures Infra can take to clean up disk space

Various places/commands that can reclaim disk space.

Working DirectoryCommandAverage/Acceptable disk spaceNotes
$JENKINS_HOME/yetus-m2find . -atime +31 -delete5GB / 2GB
$JENKINS_HOME/.m2/respositoryfind . -atime +31 -delete30GB / 10GB
$JENKINS_HOME/.gradlefind . -atime +31 -delete10GB / 2GB
$JENKINS_HOME/.$projectfind . -atime +31 -delete2GB / 250mbProjects should not be using disk space outside of their jobs workspace.
$JENKINS_HOME/$project-m2find . -atime +31 -delete2GB/ 250mbProjects should not be using disk space outside of their jobs workspace.
$JENKINS_HOME/jenkins-slave/maven-repositoriesfind . -atime +15 -delete42GB / 20GB?How is this different to .m2/repository - are we duplicating here?
$JENKINS_HOME/jenkins-slave/workspacefind . -mtime +31 -delete250GB-300GB / 165GB
$JENKINS_HOME/jenkins-slave/workspace/trafficcontrol-PR_ws-space*rm rf .350MB x 6750 directoriesThis scenario can sometimes be missed due to the directories being small in size - 350MB - but we have thousands of such directories that add up to over 100GB!

Procedures Projects can take to clean up disk space

Projects can help themselves and Infra by taking some basic steps to help clean up their jobs after themselves on the build nodes.


  1. Use a ./tmp dir in your jobs workspace. That way it gets cleaned up when job workspaces expire.
  2. Configure your jobs to wipe workspaces on start or finish.
  3. Configure your jobs to only keep 5 or 10 previous builds.
  4. Configure your jobs to only keep 5 or 10 previous artifacts.