Skip to content

Instantly share code, notes, and snippets.

View Elbandi's full-sized avatar

Andras Elso Elbandi

  • Elbandi.Net
  • Budapest
View GitHub Profile
@Elbandi
Elbandi / gist:974cef39532edd14f4574eb8d7684ba7
Last active September 13, 2021 09:45 — 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 hudson.FilePath.FileCallable;
import hudson.slaves.OfflineCause;
import hudson.node_monitors.*;
for (node in Jenkins.instance.nodes) {