Last active
March 2, 2022 06:52
-
-
Save calvinlfer/55db013f17fb8047a753174e73cc5919 to your computer and use it in GitHub Desktop.
Pushing Jenkins ThinBackup backups to S3
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/bash -l | |
# find latest backup | |
thinbackup_path="$JENKINS_HOME/thinBackup" | |
latest_backup_folder=$(ls -t $thinbackup_path | head -n1) | |
full_path="$thinbackup_path/$latest_backup_folder" | |
echo "Latest backup is located at ${full_path}" | |
# pack it up | |
backup_name="$latest_backup_folder.tar.gz" | |
tar cvzf $backup_name $full_path | |
# push to S3 | |
S3_BUCKET_BACKUP="yourcompany-jenkins-backup" | |
aws s3 cp $backup_name s3://$S3_BUCKET_BACKUP/thinBackup/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is meant for use with: