Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to retrieve deleted Jenkins job?

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.

like image 563
mahinlma Avatar asked Aug 04 '15 09:08

mahinlma


People also ask

What is backup plugin in Jenkins?

Backup plugin allows archiving and restoring your Jenkins (and Hudson) home directory. This plugin is searching for a new maintainer! Unfortunately, the current maintainer has no more time to work on this plugin, but there are still some important issues to fix.

How do I enable jobs in Jenkins?

Currently in order to enable or disable a job, a user must have Job Configure permissions in the Matrix-based security configuration. We would like to be able to manage the enable / disable job permission independently from the job configure permission.


4 Answers

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

like image 118
ahmed.ettoumi Avatar answered Oct 01 '22 03:10

ahmed.ettoumi


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).

like image 26
jussuper Avatar answered Oct 04 '22 03:10

jussuper


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.

like image 43
Christopher Orr Avatar answered Oct 03 '22 03:10

Christopher Orr


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...

like image 32
Mayur Pawar Avatar answered Oct 03 '22 03:10

Mayur Pawar