Created
March 10, 2025 12:12
-
-
Save jayveersolanki/a6a4c958137b7e4cc5c954c3377fe4aa to your computer and use it in GitHub Desktop.
Disable All Jenkins Jobs from jobs folder.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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