Skip to content

Instantly share code, notes, and snippets.

@rosenhouse
Last active January 1, 2016 09:39
Show Gist options
  • Save rosenhouse/8126177 to your computer and use it in GitHub Desktop.
Save rosenhouse/8126177 to your computer and use it in GitHub Desktop.
Reduced redundancy sync to S3
#!/bin/bash -e
SRC="$1"
DEST="$2"
echo "Starting reduced-redundancy sync of $SRC --> $DEST"
# would prefer to use this tool, but we get errors: https://github.com/aws/aws-cli/issues/401
# aws --region us-west-2 s3 sync --storage-class REDUCED_REDUNDANCY $SRC $DEST
# instead we'll use s3cmd
# EC2 instance IAM role credentials are added in version v1.5
# git clone https://github.com/s3tools/s3cmd.git
# cd s3cmd
# python setup.py install
s3cmd sync --verbose --reduced-redundancy --recursive $SRC $DEST
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment