Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Free space in Jenkins deleting 'builds' directory

Tags:

jenkins

I'm using Jenkins to execute daily tasks with my projects, but every execution, Jenkins stores a 20MB dir in PROJECT_HOME/builds, so after a lot of executions, the space in the disk of every project is huge (10GB for some Jenkins tasks).

It isn't very important for me to store the result of the previous executions, so what I want to know is that if exists a way to say Jenkins no to store that information.

Does anybody know how to avoid Jenkins to store result of old executions?

like image 802
r.rodriguez Avatar asked Nov 03 '11 11:11

r.rodriguez


People also ask

How do I clean up old Jenkins builds?

If you need to clean the Jenkins build history, and reset the build number back to 1, you can run a simple script in Jenkins Script Console. Go to Jenkins Script Console. Go to your Jenkins home page -> Manage Jenkins -> Script Console. Run this script to clean and reset.

How do I delete multiple builds in Jenkins?

There's a lot you can break using the script console. Delete the builds' folders from disk (by default in $JENKINS_HOME/jobs/JobName/builds/ , using the start time stamp as folder name) and restart Jenkins, or Reload Configuration From Disk.

How do I check my Jenkins disk space?

You can see project list with occupied disk space by going to the "Disk Usage" page in the management section (Dashboard -> "Manage Jenkins" -> "Disk Usage"). The same page also allows you to schedule disk usage calculation immediately.


1 Answers

If you go into the project's configuration page, you will find a checkbox labeled "Discard Old Builds". Enabling this allows you to specify both the number of days to retain builds for and the maximum number of builds to keep.

like image 79
jwernerny Avatar answered Sep 28 '22 21:09

jwernerny