Skip to main content
Background Image
  1. Posts/

How to backup Jenkins

·214 words·2 mins· ·
Xianpeng Shen
Author
Xianpeng Shen
Table of Contents

I believe most of you have used the Jenkins configuration as code principle, so you build/test/release process will be described in code.

It looks like all is good, but not all of the configuration is in code, same of the Jenkins system configuration is store in the Jenkins service, so we also need to backup Jenkins in case of any disaster.

There are two ways to backup Jenkins, one used Jenkins plugin, the other is create shell scripts.

Using plug-in backup
#

I used the ThinBackup plugin, here is my thinBackup configuration.

ThinBackup Configuration

  • backup to a folder which user jenkins has permission to write. this is important.

    Previously I backup Jenkins to a mount folder, but it doesn’t work recently. so I use user jenkins to log in on the Jenkins server and found my jenkins can’t access the directory, but I personal user can.

  • I will daily backup my Jenkins server, from Monday to Saturday.

  • Fo me max number of backup sets is 3, because every backup archive more than 400 MB.

  • Others check boxs

    • Backup build results
    • Backup ‘userContent’ folder
    • Backup next build number file
    • Backup plugins archives
    • Move old backups to ZIP files

Using shell script backup
#

Here is a popular repository and code for your reference.

Related

Jenkins Top 3 best practice
·906 words·5 mins
Discusses three best practices for Jenkins: Configuration as Code, Shared Libraries, and Multi-Branch Pipeline, highlighting their benefits in terms of transparency, traceability, and self-service builds.
Jenkins Multibranch Pipeline
·405 words·2 mins
Discusses the use of Jenkins Multibranch Pipeline to manage multiple branches in a project, enabling parallel builds for pull requests and efficient code review processes.
Jenkins Linux agent configuration
·298 words·2 mins
Provides a step-by-step guide on how to configure a Jenkins Linux agent, including setting up the Java runtime, creating the node, and troubleshooting common issues.
Jenkins Windows agent configuration
·544 words·3 mins
Provides a step-by-step guide on how to configure a Jenkins Windows agent, including setting up the Java runtime, creating the node, and troubleshooting common issues.
How to fix ".NET Framework 2.0 or later is required on this computer to run a Jenkins agent as a Windows service"
·211 words·1 min
Resolve the issue of Jenkins Windows agents not connecting due to missing .NET Framework, including steps to install .NET Framework 3.5 and set up the Jenkins agent service.
A Code Coverage Tool - Squish Coco use examples
·699 words·4 mins
introduction to Squish Coco, a code coverage tool, with examples of how to set it up and use it in Visual Studio for C++ projects.