Some processor or thread is cleaning up my workspace

Hi Team,

I have a around 8 pipelines in my jenkins UI. All of them are working fine and they’re listing in my jenkins UI. But out of 8, 2 of them i don’t use pretty often. I use them like once in a 2 months. Since they’re not active pipelines i suspect some backend thread is cleaning up my workspace related to those 2 pipelines. This is driving me crazy.

So can anyone help on how to disable that thread forever. Will there be any property that i need to mention in my jenkins property file?

Please help me on this. Appreciate your responses.

In script console run
hudson.model.WorkspaceCleanupThread.disable=true
This will apply until you restart Jenkins
To make it permanent you need to set this as a Java property at start, e.g. java -Dhudson.model.WorkspaceCleanupThread.disable=true -jar jenkins.war ...
or you set it in a init groovy script (Groovy Hook Scripts)

@mawinter69 Thanks for your response. I would like to make it permanently by setting the above java property. Could you please be more specific like in which file do i need to set that property with some detailed steps.

Also I installed the jenkins using the yum command. I didn’t used the jenkins.war file, so i’m doubting whether do i need to set the property with -jar jenkins.war or using any other way? Does my question make any sense?

Please let me know if you need any further info from my side.

Thanks,
Prudhvi M.

So you start Jenkins with systemctl start jenkins
See Managing systemd services and add it to JAVA_OPTS env variable

@mawinter69 Is this the exact line that i need to add in the override.conf file ?
Environment=“JAVA_OPTS=hudson.model.WorkspaceCleanupThread.disable=true”
Or
Environment=“JAVA_OPTS=-Dhudson.model.WorkspaceCleanupThread.disable=true”

Which is the correct one of above two?

The second option is the proper way to pass java properties

Thanks for your help @mawinter69. I have set the property and restarted the jenkins. Hopefully this time it shouldn’t cleanup my workspace.