Skip to content

Instantly share code, notes, and snippets.

@Mukei
Last active October 22, 2017 11:24
Show Gist options
  • Save Mukei/ca2579a2e4079c50b11842508fd37aad to your computer and use it in GitHub Desktop.
Save Mukei/ca2579a2e4079c50b11842508fd37aad to your computer and use it in GitHub Desktop.
[S3 copy snippets] #AWS #S3 #snippets #cookbook
#!
# Using aws s3 cp will require the --recursive parameter to copy multiple files.
aws s3 cp s3://myBucket/dir localdir --recursive
#The aws s3 sync command will, by default, copy a whole directory. It will only copy new/modified files.
aws s3 sync s3://mybucket/dir localdir
#Just experiment to get the result you want.
#You can combine --exclude and --include options to copy only objects that match a pattern, excluding all others.
aws s3 cp s3://mybucket/logs/ s3://mybucket2/logs/ --recursive --exclude "*" --include "*.log"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment