4
votes

Can anyone explain how to clear Jenkins agents disk space?

I need to clear the disk space of Jenkins agents. These slave machines have windows OS.It is said "Slave win7-agent-4 "connected via JNLP agent,

I don't know the method to login into these remote agents machine?.Can we access through remote desktop or any other method ?

1
If you really know what to delete, then create small script to delete those files. Create a job and run it on the specific node.Jayan
Actually i need to log into agent machine as well ?. for that there is a specific way ?. like remote desktop ?.Agent machines are kept in different network .Vinee-the-Pooh
You need to investigate who consumes disk space. It is upto you to login and check. SSH on Linux , rdesktop on windows. It is upto you, Your question lacks quite lot of information- will be closed soon.Jayan
One direct way is delete the jobs from old build, check this out: stackoverflow.com/a/42220002/6549532Kevin Li

1 Answers

1
votes

Your question is too broad. You need to check why the disk-gets full. One possible reason is each job comes to random slave and creates lot of files in its workspace. That is actually a correct workflow in Jenkins.

You can use groovy script to iterate over all slaves, check workspace of all jobs and delete the workspace content.

This is best done by script: Here is one way described https://gist.github.com/rb2k/8372402 : very cool one.

(I am not the author-not tested it )