I have Jenkins with a lot of multibranch jobs (github, organization etc), pipelines, etc.
The jobs directory takes up a lot of space - currently almost 500 GB.
I have no control over the pipeline, and I have no control over the “Discard Old Builds” strategy. I tried using the Configuration Slicing plugin, but it doesn’t seem to have worked well in this case.
What can I do from an administrative standpoint to prevent the jobs directory from growing so much?
Some log files contain debugging information, so they take up a lot of space. For now, I’ve compressed all files larger than 10M using gzip.
But there are a lot of large files generated during the build that Jenkins holds onto. Probably artifacts and the like.
When it’s artifacts that consume lots of space you can offload them externally (for new builds) by using an artifact manager plugin.
Regarding the build discarder it depends. You can configure a build discarder globally that runs regularly and not only when a job finished. You can also define different retention times for artifacts. With Build Discarder | Jenkins plugin you can ensure that jobs that don’t set a build discarder are also cleaned. Using the built in Specific Build Discarder you can enforce a maximum, i.e. if the job has a build discarder to clean after 50 days and you specify 30 globally then no job will keep logs for more than 30 days.