Last active
August 29, 2015 14:01
-
-
Save nicopaez/60ebad4311d691e803d1 to your computer and use it in GitHub Desktop.
Jenkins backup script
This file contains 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/bash | |
set -e | |
cd /var/lib/jenkins/jobs | |
cp --parent ./*/config.xml /var/jenkins-backup/repo | |
cd /var/jenkins-backup/repo | |
git add . | |
git commit -m "Config files updated" | |
git push origin master | |
chmod +x backup_jenkins.sh | |
crontab -e | |
0 2 * * * /var/jenkins-backup/backup-jenkins.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment