You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[JENKINS-834] add option to keep a number of artifacts #13831
Currently you can configure a job to keep either artifacts of all builds or only
from the latest successful build.
I have a job with quite large artifacts. I want to keep a long build history
(logs and build times). Also I would like to keep the latest 5 artifacts (or so)
to be able to analyze them etc..
For this to work I would like to have an option in the artifacts settings:
Instead of:
[ ] Discard all but the last successful artifact to save disk space
I propose:
[ ] Keep only artifacts of the last [] successful builds to save disk space
Currently you can configure a job to keep either artifacts of all builds or only
from the latest successful build.
I have a job with quite large artifacts. I want to keep a long build history
(logs and build times). Also I would like to keep the latest 5 artifacts (or so)
to be able to analyze them etc..
For this to work I would like to have an option in the artifacts settings:
Instead of:
[ ] Discard all but the last successful artifact to save disk space
I propose:
[ ] Keep only artifacts of the last [<number>] successful builds to save disk space
I have the same requirement. I don't want to delete the build, because once you
delete the build then you lose all your history then i won't be able to produce
the metrics....etc.
o We also move our artifacts into our centralized server using scp plugin, so
there is no need for hudson to keep them once we moved.
o As the data grow, hudson takes longer to load during the first time.
I have the same requirement. I don't want to delete the build, because once you
delete the build then you lose all your history then i won't be able to produce
the metrics....etc.
o We also move our artifacts into our centralized server using scp plugin, so
there is no need for hudson to keep them once we moved.
o As the data grow, hudson takes longer to load during the first time.
I would love this feature as part of the Hudson or in a plugin. I just found
out the hard way how much data I am keeping as artifacts and more control over
how long artifacts are kept would be great.
I would love this feature as part of the Hudson or in a plugin. I just found
out the hard way how much data I am keeping as artifacts and more control over
how long artifacts are kept would be great.
Hello there,
is there something new?.
i have exactly the same requirement.
At the moment i must remove the artifacts manually every week.
Maybe the priority should be set to blocker
Hello there,
is there something new?.
i have exactly the same requirement.
At the moment i must remove the artifacts manually every week.
Maybe the priority should be set to blocker
Some months ago we did a windows batch script, that keeps artifacts of tagged builds and the latest one:
@ECHO OFF
ECHO delete all builds that are not tagged or the latest one
SET JOBSPACE=C:\Dokumente und Einstellungen\Administrator\.hudson\jobs\theproduct\builds
C:
cd "%JOBSPACE%"
for /F "delims=!" %%f in ('dir build.xml /s /b') DO ( REM currently editing %%f
FINDSTR /C:"/tags/" "%%f" > nul
IF ERRORLEVEL 1 (REM echo build was not not tagged
IF /I NOT "%%f"=="%JOBSPACE%%BUILD_ID%\build.xml" (REM echo delete %%~dpfarchive (the corresponding archive folder)
rd /q /s "%%~dpfarchive" 2>nul
)
)
)
ECHO.
exit 0
I think one might take this script and modify it to delete the last n builds
I would also love to have a such a feature.
Some months ago we did a windows batch script, that keeps artifacts of tagged builds and the latest one:
@ECHO OFF
ECHO delete all builds that are not tagged or the latest one
SET JOBSPACE=C:\Dokumente und Einstellungen\Administrator\.hudson\jobs\theproduct\builds
C:
cd "%JOBSPACE%"
for /F "delims=!" %%f in ('dir build.xml /s /b') DO ( REM currently editing %%f
FINDSTR /C:"/tags/" "%%f" > nul
IF ERRORLEVEL 1 (REM echo build was not not tagged
IF /I NOT "%%f"=="%JOBSPACE%%BUILD_ID%\build.xml" (REM echo delete %%~dpfarchive (the corresponding archive folder)
rd /q /s "%%~dpfarchive" 2>nul
)
)
)
ECHO.
exit 0
I think one might take this script and modify it to delete the last n builds
@flominator, Go to project configuration, check "Discard Old builds", Click "Advanced", you'll see "Days to keep artifacts" and "Max # of builds to keep with artifacts".
Outstanding functionality, I'm so happy to see this in here finally
@flominator, Go to project configuration, check "Discard Old builds", Click "Advanced", you'll see "Days to keep artifacts" and "Max # of builds to keep with artifacts".
Outstanding functionality, I'm so happy to see this in here finally
Activity
jenkins-infra-bot commentedon Feb 25, 2009
vijayj:
Raw content of original comment:
I have the same requirement. I don't want to delete the build, because once you
delete the build then you lose all your history then i won't be able to produce
the metrics....etc.
o We also move our artifacts into our centralized server using scp plugin, so
there is no need for hudson to keep them once we moved.
o As the data grow, hudson takes longer to load during the first time.
jenkins-infra-bot commentedon Feb 25, 2009
mdonohue:
Raw content of original comment:
jenkins-infra-bot commentedon Feb 25, 2009
Raw content of original comment:
Or maybe offer configuration for the number of artifacts to keep. Thanks
jenkins-infra-bot commentedon Feb 26, 2009
Raw content of original comment:
There is now main/test/src/test/java/hudson/tasks/ArtifactArchiverTest.java so
it would not likely be too hard.
jenkins-infra-bot commentedon Feb 26, 2009
Raw content of original comment:
I think this is also relatively easy to do as a plugin, which allows you to
define a large amount of options for a desirable behavior.
jenkins-infra-bot commentedon Mar 30, 2009
mdonohue:
Raw content of original comment:
jenkins-infra-bot commentedon May 10, 2009
mdonohue:
Raw content of original comment:
jenkins-infra-bot commentedon Jun 17, 2009
davefollett:
Raw content of original comment:
I would love this feature as part of the Hudson or in a plugin. I just found
out the hard way how much data I am keeping as artifacts and more control over
how long artifacts are kept would be great.
jenkins-infra-bot commentedon Aug 11, 2009
mdonohue:
Raw content of original comment:
jenkins-infra-bot commentedon Nov 30, 2009
thosor:
Raw content of original comment:
Hello there,
is there something new?.
i have exactly the same requirement.
At the moment i must remove the artifacts manually every week.
Maybe the priority should be set to blocker
jenkins-infra-bot commentedon Nov 30, 2009
mdonohue:
Raw content of original comment:
Voting for the issue would be a more effective way of getting it attention:
http://issues.jenkins-ci.org/secure/ViewIssue.jspa?id=130907&vote=vote
jenkins-infra-bot commentedon Jan 27, 2010
Flominator:
Raw content of original comment:
I would also love to have a such a feature.
Some months ago we did a windows batch script, that keeps artifacts of tagged builds and the latest one:
@ECHO OFF
ECHO delete all builds that are not tagged or the latest one
SET JOBSPACE=C:\Dokumente und Einstellungen\Administrator\.hudson\jobs\theproduct\builds
C:
cd "%JOBSPACE%"
for /F "delims=!" %%f in ('dir build.xml /s /b') DO ( REM currently editing %%f
FINDSTR /C:"/tags/" "%%f" > nul
IF ERRORLEVEL 1 (REM echo build was not not tagged
IF /I NOT "%%f"=="%JOBSPACE%%BUILD_ID%\build.xml" (REM echo delete %%~dpfarchive (the corresponding archive folder)
rd /q /s "%%~dpfarchive" 2>nul
)
)
)
ECHO.
exit 0
I think one might take this script and modify it to delete the last n builds
jenkins-infra-bot commentedon Mar 5, 2010
Raw content of original comment:
Code changed in hudson
User: : abayer
Path:
trunk/hudson/main/core/src/main/java/hudson/model/Run.java
trunk/hudson/main/core/src/main/java/hudson/tasks/LogRotator.java
trunk/hudson/main/core/src/main/resources/hudson/tasks/LogRotator/config.jelly
trunk/hudson/main/test/src/test/java/hudson/tasks/ArtifactArchiverTest.java
trunk/hudson/main/test/src/test/java/hudson/tasks/LogRotatorTest.java
trunk/www/changelog.html
http://jenkins-ci.org/commit/28293
Log:
[FIXED JENKINS-834] Added advanced option to delete artifacts without deleting the rest of the build
jenkins-infra-bot commentedon Mar 5, 2010
Raw content of original comment:
This will be live in 1.350.
jenkins-infra-bot commentedon May 2, 2010
Flominator:
Raw content of original comment:
Where exactly can I find the new option?
jenkins-infra-bot commentedon Jul 14, 2010
allenr:
Raw content of original comment:
@flominator, Go to project configuration, check "Discard Old builds", Click "Advanced", you'll see "Days to keep artifacts" and "Max # of builds to keep with artifacts".
Outstanding functionality, I'm so happy to see this in here finally
jenkins-infra-bot commentedon Nov 24, 2025
[Original
is_duplicated_byfrom Jira: JENKINS-1298]jenkins-infra-bot commentedon Nov 24, 2025
[Original
is_duplicated_byfrom Jira: JENKINS-2144]jenkins-infra-bot commentedon Nov 24, 2025
[Original
is_duplicated_byfrom Jira: JENKINS-3343]jenkins-infra-bot commentedon Nov 24, 2025
[Original
is_duplicated_byfrom Jira: JENKINS-4198]