Jenkins : Wipe out workspaces of all jobs

Useful before you make a copy or backup of your Jenkins installation.

This script wipes out the workspaces of all jobs on your Jenkins server

import hudson.model.*
// For each project
for(item in Hudson.instance.items) {
  // check that job is not building
  if(!item.isBuilding()) {
    println("Wiping out workspace of job "
  else {
    println("Skipping job "", currently building")