Skip to content

Instantly share code, notes, and snippets.

@brpaz
Forked from magnetikonline/README.md
Last active August 29, 2015 14:14
Show Gist options
  • Save brpaz/53239f976ffdb01f7511 to your computer and use it in GitHub Desktop.
Save brpaz/53239f976ffdb01f7511 to your computer and use it in GitHub Desktop.
AWS CLI S3 usage examples. #aws #s3

AWS CLI S3 usage examples

Local dir to remote bucket sync

$ aws s3 sync \
	--dryrun \
	--region ap-southeast-1 \
	--delete \
	/path/to/files/ \
	s3://BUCKET.NAME/path/to/dest

Local dir to remote bucket copy with gzip content encoding header

$ aws s3 cp \
	--dryrun \
	--region ap-southeast-1 \
	--recursive \
	--content-encoding 'gzip' \
	/path/to/files/ \
	s3://BUCKET.NAME/path/to/dest

Remote to remote bucket copy

$ aws s3 cp \
	--dryrun \
	--region ap-southeast-1 \
	--recursive \
	s3://BUCKET.NAME/path/to/source \
	s3://BUCKET.NAME/path/to/dest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment