Skip to content

Instantly share code, notes, and snippets.

@trecloux
Last active May 31, 2016 17:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trecloux/1d0b5557692dc2932e00e2b4f99c670e to your computer and use it in GitHub Desktop.
Save trecloux/1d0b5557692dc2932e00e2b4f99c670e to your computer and use it in GitHub Desktop.
import hudson.model.*
import hudson.tasks.*
for(item in Hudson.instance.items) {
print("job "+item.name)
item.buildDiscarder = new LogRotator(-1, 5, -1, -1)
println (" configured")
}
for(item in Hudson.instance.items) {
print("job "+item.name)
try {
item.logRotate()
println (" rotated")
} catch (IOException e) {
println("################### FAILED" + e.message)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment