hi can you provide me whole groovy code

On Friday, October 7, 2011 at 4:11:28 AM UTC-6, Christopher Orr wrote:
>
> On 06/10/11 21:19, jdhein wrote:
> > My organization has just tons of projects in Jenkins, many of which
> > are not active and have not built in some time, some of them haven't
> > built in over 17 months. I have gone through and turned on "discard
> > old builds" with a max of 10 builds. However, it has been weeks since
> > changing this setting and Jenkins has not deleted the excess builds. I
> > am guessing I have to poke the bear by kicking off a build... only, I
> > don't want to do this for projects I am not directly involved with.
> >
> > Is there a way to tell Jenkins to go ahead and discard the old builds
> > right now?
>
> You can use the Script Console to fetch the jobs you want, and then call 
> logRotate() on each of them.
>
> Probably something like this should work, not that I've tested it:
>
> for(job in Hudson.instance.items) {
>    job.logRotate()
> }
>
>
> Take a look at the examples on the wiki for more info, and if you come 
> up with something good, you can add it to the list:
> https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+Script+Console
>
> Regards,
> Chris
>
>

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/b9cd4421-ffc1-4fc6-b86c-91ba106b87e6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to