Plugin Information
This plugin simply backs up the global and job specific configurations (not the archive or the workspace). CompatibilityThis plugin needs Hudson 1.377 (1.409 or greater recommended) or newer for automated backups (manual backups also work in older versions). Why another backup pluginThe Backup Plugin only does manual backups, and stores all data found in JENKINS_HOME. This is sometimes (e.g. big Jenkins environment) not practical because of time and disk space requirements, and because it can only be manually triggered. thinBackups can be scheduled and only backs up the most vital configuration info. DocumentationThis plugin adds another management link to 'Manage Hudson' called ThinBackup which looks like this: This new link provides the following actions: Backup NowTriggers a manual full back up right now. Restore
Note: The file 'nextBuildnumber' will not be backed up or restored to prevent buildnumber collision by default. The archive and the workspace will not be deleted or changed, but all backed up files will simply be overwritten with the restored versions (e.g. config.xml, thinBackup.xml -> for more info simply look in a backup).
Restore next build number file (if found in backup)If this option is enabled, the file nextBuildNumber will also be restored. Restore pluginsIf this option is enabled, the plugins get restored. You need an active internet connection to the update server, because plugins will be downloaded from the update server to keep the backup small. SettingsBackup directorySpecify the backup directory. The Jenkins process needs write access to this directory. You can use environment variables like ${JENKINS_WORKSPACE} to specify the path. Backup schedule for full backupsSpecify schedule when a full backup is triggered. Cron notation is used. A full backup backs up all files even if there were no changes. Backup schedule for differential backupsSpecify schedule when a differential backup is triggered. Cron notation is used. A differential backup stores only modified data since the last full backup. If there are no changes detected, no diff backup will be created. Note: You do not need to specify a differential backup schedule if you only need full backups. Because differential backups depend on full backups, a schedule for full backups is mandatory if you specify a differential backup schedule. Wait until Jenkins/Hudson is idle to perform a backupIt is very recommended to enable this option (default). Nevertheless, many users report that the quiet mode is blocking the execution of long running jobs. If you disable this option the backup will be made without waiting for a safe state of your instance. In other words, the backup will be done immediately, and this could cause corrupt backups. Force Jenkins to quite mode after specified minutesForce a quiet mode after the specified time in minutes to force a safe environment for the back up. Zero means the quite mode is forced directly when the back up is triggered by the scheduler. Read more about the back up process below. Max number of backup setsTo save disk space, you can specify the maximum number of stored backup sets. A backup set is defined as a full backup together with its referencing diff backups. Older backup sets will be deleted after the next full backup action. This also applies to zipped backup sets. Files excluded from backupIf you have specific files you do not want to back up, entering a regex here which identifies those files will prevent them being backed up. All files with a name matching this regular expression will not be backed up. Leave empty if not needed. If the expression is invalid, it will be disregarded. Back up build resultsIf this option is enabled, build results will also be backed up. This is potentially a lot of data, so think carefully about it. Once you decide to backup build results you get also to option about backup your build archives. Once again, be careful with this option, because it could be very time consuming and needs probably a lot of disk space! Back up 'userContents'Jenkins provides a URL where you can put common data (e.g. static HTML, Tools, ...). you can back up all these data if you check this option. Backup only builds marked to keepIf this option is enabled, only builds results/artifacts on builds which are marked "Keep this build forever" are backed up. Clean up differential backupsIf this option is enabled, all differential backups are removed whenever a new full backup is done. Move old backups to ZIP filesIf this is checked, then whenever a new full backup is performed all old backup sets will be moved to ZIP files. Each ZIP file will contain one backup set, i.e. one full backup and any diff backups referencing it. The file name will identify the time frame where the backups are included (i.e. the time stamp of the full backup and the time stamp of the latest diff backup). Note: The setting "Max number of backup sets" applies to backup ZIP files created by thinBackup as well. Note: In case "Clean up differential backups" is checked, diff cleanup will be performed before zipping is done, and therefore no diff backups will be in the ZIP files. Back up processBecause many of you are asking why Jenkins is going to shutdown when a back up is triggered, I decided to explain my ideas behind the back up process. So what is a safe environment? How it works, an example:
Changelog
Feature RequestsPlease let us know if you would have another option or feature for this plugin by simply enter an issue or write us an email. THANKS |
thinBackup
Skip to end of metadata
Go to start of metadata
Comments (13)
May 26, 2011
hbockelmann - says:
I have ThinBackup plugin version 1.2 installed on jenkins 1.411 running on CentO...I have ThinBackup plugin version 1.2 installed on jenkins 1.411 running on CentOS 5.6
Leaving "schedule for full backups" and "schedule for differential backups" empty gives the log output:
May 26, 2011 9:35:35 AM hudson.model.AsyncPeriodicWork$1 run
INFO: Started ThinBackup Worker Thread
May 26, 2011 9:35:35 AM hudson.model.AsyncPeriodicWork$1 run
INFO: Finished ThinBackup Worker Thread. 0 ms
every minute ...
But setting the schedule to "0 12 * * 7" for full and to "0 12 * * *" for differential backups, results in the log output:
May 26, 2011 9:47:35 AM hudson.model.AsyncPeriodicWork$1 run
INFO: Started ThinBackup Worker Thread
May 26, 2011 9:47:35 AM org.jvnet.hudson.plugins.thinbackup.ThinBackupPeriodicWork calculateDelay
SEVERE: Delay is a negative number, which means the next execution is in the past! Something bad happened.
Exception in thread "ThinBackup Worker Thread thread" java.lang.IllegalStateException: Delay is a negative number, which means the next execution is in the past! Something bad happened.
at org.jvnet.hudson.plugins.thinbackup.ThinBackupPeriodicWork.calculateDelay(ThinBackupPeriodicWork.java:147)
at org.jvnet.hudson.plugins.thinbackup.ThinBackupPeriodicWork.getNextScheduledBackup(ThinBackupPeriodicWork.java:104)
at org.jvnet.hudson.plugins.thinbackup.ThinBackupPeriodicWork.execute(ThinBackupPeriodicWork.java:65)
at hudson.model.AsyncPeriodicWork$1.run(AsyncPeriodicWork.java:51)
at java.lang.Thread.run(Thread.java:636)
What happens here?
Jun 09, 2011
Frank Schophuizen says:
Just an idea... Maybe you should use 0 for Sunday instead of 7. BTW, I also see...Just an idea... Maybe you should use 0 for Sunday instead of 7.
BTW, I also see the logging of starting and finishing the ThinBackup Worker Thread. I wonder why should it be started every minute, if the backup is scheduled once a day?
6-jun-2011 19:18:56 hudson.model.AsyncPeriodicWork$1 run
INFO: Started ThinBackup Worker Thread
6-jun-2011 19:18:56 hudson.model.AsyncPeriodicWork$1 run
INFO: Finished ThinBackup Worker Thread. 0 ms
Jun 10, 2011
BB Tksh says:
+1 Every minute loggings are very annoying. At least for us, every hour log...+1
Every minute loggings are very annoying.
At least for us, every hour log is enough ...
Jul 04, 2011
Thomas Fuerer says:
fist of all; sorry i didn't see your comments on this page because I visit this ...fist of all; sorry i didn't see your comments on this page because I visit this page not very often.
PLEASE give us feedback only via JIRA or e-mail if you need a quick or reliable answer.
second: The problem with the logging is an internal problem of jenkins, because the scheduler logs every time it will be called. I need to call this every minute because the the interval of CRON is at least one minute. I asked the core team if we could change the log level of this log statement but I get no response.
So for the next release I duplicated the code and remove the log statement -> so no more annoying logs.
third: thank you for using thinBackup ;-)
Dec 20, 2011
Adil Akhund-Zade says:
Does not save build results for matrix projects.Does not save build results for matrix projects.
Jul 02, 2012
Mike Petterson says:
Hi, As I understand you can do a scheduled backup. Suppose that I have an...Hi,
As I understand you can do a scheduled backup. Suppose that I have another instance of jenkins ( dev server) running somewhere else ( also with your nice plugin installed). If I check the backup directory and find a new version of backup data can I from CLI do restore of this new version into my dev server ( just to make sure we keep it up-to-date).
br,
//mike
Aug 13, 2012
rsaddey - says:
Not really an issue, but just-in-case you're still using Java 5: thinBackup requ...Not really an issue, but just-in-case you're still using Java 5: thinBackup requires Java 6.
See JENKINS-13874 - java.lang.NoSuchMethodError: java/lang/String.isEmpty()Z
Oct 05, 2012
Gerald Bringhurst says:
I don't think this was a well thought out plugin: As soon as you kick off a 'th...I don't think this was a well thought out plugin:
As soon as you kick off a 'thinbackup', you cannot start any new jobs, and it won't back ANYTHING up, until ALL of the currently running jobs are done.
So, if I am on day two of a four day test, no jobs will start and run for two days! oops! and you CANNOT cancel the backup!
How about, 'thinbackup' tags the xml/configurations it cannot backup (i.e. jobs that are running), and back them up as soon as the are free.
Otherwise in order to get jenkins back to a point where jobs can be triggered and run, you need to restart the service, and lose days of testing or build data.
Nov 06, 2012
Thomas Fuerer says:
Hi, If you do not like to wait for what I called secure environment, you can ju...Hi,
If you do not like to wait for what I called secure environment, you can just disable this by uncheck "Wait until Jenkins/Hudson is idle to perform a backup".
Yes, for now it is not possible to cancle the backup, but I never needed it until today because my backup is running overnight and takes only a view minutes. I suggest to add an issue to JIRA and I or some one else will add it as a new feature. Also the other idea be marking "unsafe" jobs and skip it or do the backup later would be an interessting alternative way to work around the problem. Once again my first goal was to insure a complete and safe backup, because incomplete backups will not help very well in case of an desaster.
If you don't think that this plugin will not work for you, you have some options:
Blaming us will not help us very well, and of course this plugin is not perfect. I have many ideas but less time, and basically it works for me and a lot of other peoples. We will work to steady improve this plugin because I do not want to loose my setup again because of a hardware defect.
thomas
Oct 31, 2012
Ruben Perez says:
It doesn't have support for Cloudbees Folders.... It's not backup up the jobs in...It doesn't have support for Cloudbees Folders.... It's not backup up the jobs inside.... Big downside....
Dec 20, 2012
Barrett Strausser says:
The scheduled backup is not working for me. I can run the backup manually so I k...The scheduled backup is not working for me. I can run the backup manually so I know it isn't a permissions issue. It appears not to run at all at the scheduled times. I have ensured no jobs were running during the scheduled times.
Where should I look in the logs for more information.
Jul 15, 2013
Josuha Henn says:
Getting the follow exception, looks like its failing when source directory doesn...Getting the follow exception, looks like its failing when source directory doesn't exist.
SEVERE: Cannot perform a backup. Please be sure jenkins/hudson has write privileges in the configured backup path '/tmp/jenkins-backup'.
java.io.FileNotFoundException: Source '/var/lib/jenkins/jobs/backup - offsite/builds/lastSuccessfulBuild' does not exist
at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:866)
at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:814)
at org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup.backupBuildFiles(HudsonBackup.java:302)
at org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup.backupBuildsFor(HudsonBackup.java:270)
at org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup.backupJob(HudsonBackup.java:208)
at org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup.backupJobsDirectory(HudsonBackup.java:196)
at org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup.backupJobs(HudsonBackup.java:175)
at org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup.backup(HudsonBackup.java:142)
at org.jvnet.hudson.plugins.thinbackup.ThinBackupPeriodicWork.backupNow(ThinBackupPeriodicWork.java:87)
at org.jvnet.hudson.plugins.thinbackup.ThinBackupMgmtLink$1.execute(ThinBackupMgmtLink.java:76)
at org.jvnet.hudson.plugins.thinbackup.hudson.model.AsyncPeriodicWork$1.run(AsyncPeriodicWork.java:54)
at java.lang.Thread.run(Thread.java:679)
Aug 12, 2013
Ming Ho says:
Has anybody seen this? some of my jobs' "lastFailedBuild" point to "-1" si...Has anybody seen this? some of my jobs' "lastFailedBuild" point to "-1" since they have never failed or failed builds no longer exist.
Aug 12, 2013 11:27:47 AM org.jvnet.hudson.plugins.thinbackup.ThinBackupPeriodicWork backupNow
SEVERE: Cannot perform a backup. Please be sure jenkins/hudson has write privileges in the configured backup path '/storage/backups'.
java.io.FileNotFoundException: Source '/storage/jenkins/jobs/Remix_3.x/builds/lastFailedBuild' does not exist
at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:866)
at org.apache.commons.io.FileUtils.copyDirectory(FileUtils.java:814)
at org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup.backupBuildFiles(HudsonBackup.java:302)
at org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup.backupBuildsFor(HudsonBackup.java:270)
at org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup.backupJob(HudsonBackup.java:208)
at org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup.backupJobsDirectory(HudsonBackup.java:196)
at org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup.backupJobs(HudsonBackup.java:175)
at org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup.backup(HudsonBackup.java:142)
at org.jvnet.hudson.plugins.thinbackup.ThinBackupPeriodicWork.backupNow(ThinBackupPeriodicWork.java:87)
at org.jvnet.hudson.plugins.thinbackup.ThinBackupMgmtLink$1.execute(ThinBackupMgmtLink.java:76)
at org.jvnet.hudson.plugins.thinbackup.hudson.model.AsyncPeriodicWork$1.run(AsyncPeriodicWork.java:54)
at java.lang.Thread.run(Thread.java:636)
Add Comment