- Local dir to remote bucket sync
- Local dir to remote bucket copy with gzip content encoding header
- Remote to remote bucket copy
$ aws s3 sync \
--dryrun \
--region REGION_NAME \
--delete \
/path/to/files/ \
s3://BUCKET_NAME/path/to/dest
$ aws s3 cp \
--dryrun \
--region REGION_NAME \
--recursive \
--content-encoding 'gzip' \
/path/to/files/ \
s3://BUCKET_NAME/path/to/dest
$ aws s3 cp \
--dryrun \
--region REGION_NAME \
--recursive \
s3://BUCKET_NAME_SOURCE/path/to/source \
s3://BUCKET_NAME_TARGET/path/to/dest
That's correct - credentials come from either
~/.aws/credentials
(controlled by--profile
) or environment variables are the other choice.You never give these keys over the CLI itself, nor is it even possible - since these things could be captured by other processes way too easily.