Hi Bertrand,

Would you mind to share your script again please?

./Frédéric

Le mercredi 30 mai 2012 12:01:38 UTC+2, Bertrand Renuart a écrit :
>
> For those that are interested, I solved the issue by writing a small 
> Groovy script that gets executed periodically. 
> This script goes through the online slaves, list the content of their 
> workspaces and delete any subdirectories whose name does not match any 
> existing job configuration. It must be executed on the master node 
> (apparently slaves do not have access to job configuration - which seems 
> normal). 
>
> The script is available at http://snipt.org/ujhhd4. 
>
> Unfortunately, only the slaves that are online at the time the script is 
> executed are cleaned up... Ideally, the script should also be executed when 
> a slave connects. For that reason, I'm thinking about writing a java plugin 
> for Jenkins that would handle the cleanup. 
>
>
> -----Original Message----- 
> From: [email protected] <javascript:> [mailto:
> [email protected] <javascript:>] On Behalf Of Simon Wiest 
> Sent: mercredi 16 mai 2012 15:01 
> To: [email protected] <javascript:> 
> Subject: Re: Workspace cleanup after job removal 
>
> Hi Bertrand, 
>
> Jenkins does not explicitly delete the workspace of a job when deleting 
> the job. 
>
> But if your job happens to reside on the master and your workspace happens 
> to reside within your job directory (this is the default), deleting the job 
> will also remove its workspace implicitly. 
>
> If your workspace resides on a slave or outside your job directory, 
> Jenkins will not delete it. I guess, this would be also tricky to 
> implement: First, it would require Jenkins to keep a list of all slaves 
> that have ever built that very job. Second, a slave might be off-line 
> during job removal. What would happen with the workspace on this slave 
> then? Will it be deleted, when the slave comes on-line again? 
>
> Sorry, no extended magic here - yet ;O). 
>
> Cheers, 
> Simon. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/4c2fc4c2-20e0-4b1b-bbe0-6e5263a270d0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to