Setting system parameters via script console

Hi,

We have our shared workspaces deleted every 30 days, which we don’t want, and have read posts regarding the workspace clean up settings. I`m unable to restart jenkins as we are in the middle of our release build window but can i set system parameters via the Manage Jenkins → Script console?

I want to set hudson.model.WorkspaceCleanupThread.disabled=true to see if this stops the workspaces from being deleted.

Thanks

Yes you can do this via script console. It should stop the cleanup thread from executing

I haven’t used the script console before and i’m reading up on it now.

Do I just enter hudson.model.WorkspaceCleanupThread.disabled=true into the script console or need to create a script with extra bits? I`m guessing this is temporary until i set it as a java command at startup?

Just execute

hudson.model.WorkspaceCleanupThread.disabled=true

This will last until Jenkins is restarted.
To have that permanent either add exactly this line to an init script
or set a java property for the java command

java -Dhudson.model.WorkspaceCleanupThread.disabled=true ... -jar jenkins.war ...
1 Like

Perfect. Thanks very much for your help.

1 Like