Skip to content

Instantly share code, notes, and snippets.

@cig0
Forked from magnetikonline/README.md
Created January 19, 2018 15:26
Show Gist options
  • Save cig0/30d17abe8878c4acb9f7f1a3507236f4 to your computer and use it in GitHub Desktop.
Save cig0/30d17abe8878c4acb9f7f1a3507236f4 to your computer and use it in GitHub Desktop.
AWS CLI S3 usage examples.

AWS CLI S3 usage examples

Local dir to remote bucket sync

$ aws s3 sync \
	--dryrun \
	--region REGION_NAME \
	--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 REGION_NAME \
	--recursive \
	--content-encoding 'gzip' \
	/path/to/files/ \
	s3://BUCKET_NAME/path/to/dest

Remote to remote bucket copy

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