Jenkins is deleting workspaces on slaves Jenkins is deleting workspaces on slaves jenkins jenkins

Jenkins is deleting workspaces on slaves


Refer to Jenkins Features Controlled with System Properties

  • hudson.model.WorkspaceCleanupThread.disabled[ false ]Don't clean up old workspaces on slave nodes

  • hudson.model.WorkspaceCleanupThread.recurrencePeriodHours[ 24 ]How often workspace cleanup should run, in hours.

  • hudson.model.WorkspaceCleanupThread.retainForDays[ 30 ]Unused workspaces are retained for this many days before qualifying for deletion

If you have more than one node and jobs can float across nodes, you really want them cleaned up.

The order of parameters in the startup command is important, but basically these options belong at the end.

Refer to: RPM launcher or Docker launcher

It becomes:$JENKINS_JAVA_CMD $JENKINS_JAVA_OPTIONS -DJENKINS_HOME=$JENKINS_HOME -jar $JENKINS_WAR $JENKINS_PARAMS

UPDATE: As of LTS 222.1(ref. to Changelog notes), Jenkins introduced a global build discarder default. It's worth reading Cloudbee's - Best Strategy for Disk Space Management: Clean Up Old Builds