Skip to content

Instantly share code, notes, and snippets.

@abola
Last active October 1, 2022 19:44
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save abola/05b0a2ba639a1e9e647d to your computer and use it in GitHub Desktop.
Save abola/05b0a2ba639a1e9e647d to your computer and use it in GitHub Desktop.
Jenkins Full Backup Script
#!/bin/sh
###
# Easy Jenkins backup script
#
# Save script and named JenkinsFullBackup.sh
# chmod +x JenkinsFullBackup.sh
#
# Which path of your jenkins install
JENKINS_HOME=/var/lib/jenkins
# Whcih path of your backup file saved
JENKINS_BACKUP_HOME=/var/backup/jenkins
# Jenkins backup file ex: jenkins-backup.2014-10-05.tar.gz
JENKINS_BACKUP_FILE=jenkins-backup.$(date +"%Y-%m-%d").tar.gz
cd $JENKINS_HOME
# backup workspace need lot of diskspace, you can ignore like
# --exclude=./workspace
tar zcvf $JENKINS_BACKUP_HOME/$JENKINS_BACKUP_FILE ./* \
--exclude=./war
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment