Skip to content

Instantly share code, notes, and snippets.

@rodrigozrusso
Last active June 16, 2022 15:13
Show Gist options
  • Save rodrigozrusso/2db220ac9b2a608b0b97 to your computer and use it in GitHub Desktop.
Save rodrigozrusso/2db220ac9b2a608b0b97 to your computer and use it in GitHub Desktop.
Force log rotate in Jenkins
Jenkins.instance.getItemByFullName('<job-name>').each {
try {
println(it.logRotator.perform(it))
} catch (Exception e) {
println("It didn't work: "+ e)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment