Skip to content

Instantly share code, notes, and snippets.

@nmagee
Created November 6, 2017 19:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nmagee/6bc36855cfa4d0c26ba252ebb4cd8be8 to your computer and use it in GitHub Desktop.
Save nmagee/6bc36855cfa4d0c26ba252ebb4cd8be8 to your computer and use it in GitHub Desktop.
Synchronize an S3 bucket with a local folder
#!/bin/bash
bucket='YOUR-BUCKET-NAME'
dir='/your/local/directory/'
aws s3 sync s3://$bucket/ $dir
# If you want the bucket to match the local directory exactly, including any files
# you may delete at a later point, add --delete after sync
#
# aws s3 sync --delete s3://$bucket/ $dir
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment