Last active
August 29, 2015 14:06
-
-
Save keithchambers/dde686fce70b426b8670 to your computer and use it in GitHub Desktop.
Sync s3 backed yum repo
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 -e | |
readonly REPO_DIR="$1" | |
readonly S3_BUCKET="$2" | |
if [[ -z "$2" ]] ; then | |
echo "Usage: "$0" <repo-dir> <s3-bucket>" | |
exit 1 | |
fi | |
mkdir -p "$REPO_DIR" | |
s3cmd get --recursive --skip-existing s3://"$S3_BUCKET"/ "$REPO_DIR"/ | |
createrepo "$REPO_DIR"/ | |
s3cmd sync --delete-removed "$REPO_DIR"/ s3://"$S3_BUCKET"/ | |
# EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment