Skip to content

Instantly share code, notes, and snippets.

@sebbrandt87
Last active November 30, 2018 12:38
Show Gist options
  • Save sebbrandt87/32f845da3a76c331d2050fe5cc792201 to your computer and use it in GitHub Desktop.
Save sebbrandt87/32f845da3a76c331d2050fe5cc792201 to your computer and use it in GitHub Desktop.
jenkins-backup.sh
#!/usr/bin/env bash
set -o errexit
set -o xtrace
rsync -aP \
--exclude 'war' \
--exclude 'jenkins.war' \
--exclude '*.tmp' \
--exclude '*.bak' \
--exclude '.ssh' \
--exclude '.oracle_jre_usage' \
--exclude '.owner' \
--exclude '.gitignore' \
--exclude '.java' \
--exclude '.groovy' \
--exclude '.cache' \
--exclude '.bash_history' \
--exclude '.gradle' \
--exclude 'cache' \
--exclude 'caches' \
--exclude 'fingerprints' \
--exclude 'logs' \
--exclude 'monitoring' \
--exclude 'userContent' \
--exclude 'workspace' \
--exclude 'builds' \
--exclude 'lastStable' \
--exclude 'lastSuccessful' \
--exclude '*.log' \
$1/ $2/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment