Jenkins somehow creates ws-cleanup_timestamp file

Viewed 4456

I have a Jenkins job, that triggers a script. Everything is ok, but in the foulder, where a script is placed, it creates a file with name

JOBNAME_ws-cleanup_TIMESTAMP

JOBNAME AND TIMESTAMP are variables from a Jenkins job.

Why does it happen. Why does Jenkins create a file?

2 Answers

This bug still persists in 2020. As a walk around we did manual deletion with crontab. This is a very dirty way, but it works and stabilizes the CPU consumption of Jenkins. Please take your own responsibility enabling this command.

crontab -e

1 1 1 1-12 * cd /var/lib/jenkins/workspace/ && find . -type d -name "*_ws-cleanup_*" -exec rm -rf {} +

Crontab explanation:

“At 01:01 on day-of-month 1 in every month from January through December.”

Related