I do not advise you to run this on production. You can first test it on a test instance to see how it acts on your Jenkins instance.
All jenkins jobs are saved in the form of config.xml
in the jenkins home directory. For example, in /var/lib/jenkins
IN every job XML, you have a parameter <disabled>
under <canRoam>
. So all you need to do it replace the disabled parameter to true under canRoad. You can do that using the following Linux bash script. Make user you run the script from the jobs
directory which is present in the jenkins home directory.
#!/bin/bash
for job in `find . | grep -i config.xml`
do
sudo sed -i '/<canRoam>false<\/canRoam>/{n;s/.*/<disabled>true<\/disabled>/}' $job
done
Restart jenkins for the changes to take effect.