4

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 ?

Jayan
  • 18,003
  • 15
  • 89
  • 143
Vinee-the-Pooh
  • 835
  • 3
  • 10
  • 27
  • 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 Aug 08 '15 at 11:41
  • 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 Aug 08 '15 at 17:38
  • 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 Aug 09 '15 at 02:28
  • One direct way is delete the jobs from old build, check this out: http://stackoverflow.com/a/42220002/6549532 – Kevin Feb 14 '17 at 07:17

1 Answers1

1

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 )

Jayan
  • 18,003
  • 15
  • 89
  • 143