How to remove old builds in jenkins?

Dark Star1 picture Dark Star1 · Nov 6, 2015 · Viewed 43.4k times · Source

I removed old build folders from the build directory in Jenkins expecting them to be removed in the UI, unfortunately whilse these build directories are gone, their UI link still exists. I now have two questions:

  1. How can I get rid of the defunct links in the UI?
  2. How can I delete old build from cli and have it reflected in the UI?

Answer

devesh picture devesh · Nov 6, 2015

A better way to remove old builds is discard-old-build plugin where you can specify how many builds you want to keep and all older builds are discarded.