Skip to content

Instantly share code, notes, and snippets.

@wmakeev
Last active October 17, 2017 07:12
Show Gist options
  • Save wmakeev/3d9af17dd476a5bdda11 to your computer and use it in GitHub Desktop.
Save wmakeev/3d9af17dd476a5bdda11 to your computer and use it in GitHub Desktop.
S3 sync #s3 #cli #sync
#!/usr/bin/env bash
# http://docs.aws.amazon.com/cli/latest/reference/s3/cp.html
aws s3 cp /tmp/foo/ s3://bucket/ --recursive --exclude "*" --include "*.jpg"
#!/usr/bin/env bash
# Sync local folder to S3 bucket
# Script run
# Add script permission to run
# chmod +x ./sync.sh
# http://docs.aws.amazon.com/cli/latest/reference/s3/sync.html
aws s3 sync . s3://bucket-name/path/to/folder \
--acl public-read \
--exclude '.DS_Store' \
--storage-class REDUCED_REDUNDANCY \
--delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment