Skip to content

Instantly share code, notes, and snippets.

@yogeshlonkar
yogeshlonkar / gist:15ec2441e27c0fac3dbf10fbe4cf36bc
Last active June 8, 2017 15:54 — forked from rb2k/gist:8372402
A jenkins script to clean up workspaces on slaves
// Check if a slave has < 10 GB of free space, wipe out workspaces if it does
import hudson.model.*;
import hudson.util.*;
import jenkins.model.*;
import jenkins.branch.*;
import hudson.FilePath.FileCallable;
import hudson.slaves.OfflineCause;
import hudson.node_monitors.*;