Skip to content

Instantly share code, notes, and snippets.

@kaosf
Created July 27, 2016 15:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaosf/16e0189970d0babfe66a143853e5abff to your computer and use it in GitHub Desktop.
Save kaosf/16e0189970d0babfe66a143853e5abff to your computer and use it in GitHub Desktop.
# Clean at first
rm -f backup_*.tar.gz
URL=https://raw.githubusercontent.com/sue445/jenkins-backup-script/0.1.8/jenkins-backup.sh
if type curl; then
curl $URL | bash -s /var/lib/jenkins backup_`date +"%Y%m%d%H%M%S"`.tar.gz
elif type wget; then
wget $URL -O - | bash -s /var/lib/jenkins backup_`date +"%Y%m%d%H%M%S"`.tar.gz
else
echo "There is neighter curl nor wget."
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment