Skip to content

Instantly share code, notes, and snippets.

@jayveersolanki
Created March 10, 2025 12:12
Show Gist options
  • Save jayveersolanki/a6a4c958137b7e4cc5c954c3377fe4aa to your computer and use it in GitHub Desktop.
Save jayveersolanki/a6a4c958137b7e4cc5c954c3377fe4aa to your computer and use it in GitHub Desktop.
Disable All Jenkins Jobs from jobs folder.
#!/bin/bash
# Check to see if your jenkins home is in
# /var/lib/jenkins. If it isn't, then modify the script
# This will traverse through all your jobs, and disable them.
cd /var/lib/jenkins/jobs
for d in */ ; do
cd "$d"
sudo sed -i 's/disabled>false/disabled>true/' config.xml
cd ../
done
# Restart Jenkins just to be safe.
sudo /etc/init.d/jenkins restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment