Avoid the large Jenkins log file (and stop the build if necessary)

We use Jenkins (on Linux) to manage our Maven builds.

Our users can create their own work, and sometimes (3 or 4 times a year), they make a mistake, and the task generates a large log file (79 GB for the last time ...).

I looked at existing plugins and I did not find anything to control the size of the Jenkins log.

For example, if the log size exceeds 200 MB (when the job is running), I would like to automatically stop the build.

If you have developed such shell scripts or Jenkins plugins, can you share your solution?

Thanks:)

+7
jenkins diskspace jenkins-plugins
source share
1 answer

You can use the Logfilesizechecker plugin :

This plugin controls the size of the output assembly file and interrupts the assembly if the log file becomes too large.

Or, if it also affects the runtime, a plugin to create a timeout :

This plugin allows you to automatically abort an assembly if it takes too much time. Once the timeout is reached, Jenkins behaves as if an invisible hand had pressed the "abort build" button.

+8
source share

All Articles