Last active
October 1, 2022 19:44
-
-
Save abola/05b0a2ba639a1e9e647d to your computer and use it in GitHub Desktop.
Jenkins Full Backup Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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