Reputation: 1248
Is there any method or plugins available to retrieve deleted Jenkins job?
I have mistakenly deleted one job from Jenkins. So please give a suggestion to undo the delete.
Upvotes: 39
Views: 65888
Reputation: 783
In fact you have just to use this url to reactivate your deleted job :
http://[url_of_jenkins]/jobConfigHistory/?filter=deleted
You just need to have this plugin installed beforehand: https://wiki.jenkins.io/display/JENKINS/JobConfigHistory+Plugin
Upvotes: 54
Reputation: 35
Download Plugin Job Config History
Download steps:- Manage Jenkins -> Manage Plugin -> Available -> JobConfigHistory Download and install
After Installation step:- Jenkins -> Job Config History -> Show deleted jobs only and restore the jobs
Peace...
Upvotes: 1
Reputation: 111565
Job configs are stored on disk under $JENKINS_HOME/jobs
, so if you have a backup of that directory, then you can restore the job.
Otherwise, there's no "recycle bin" for deleted jobs in Jenkins.
In future, if you want to remove a rarely-used job from Jenkins, but there's a small chance that you might want to use it in the future, you can archive the job using the Shelve Project plugin.
Upvotes: 7
Reputation: 3527
It is not possible unless you somehow restore files from your master operating system. In future you can use plugin: https://wiki.jenkins-ci.org/display/JENKINS/JobConfigHistory+Plugin. This plugin saves configuration files for deleted jobs (but not build history).
Upvotes: 12