将 amazon s3 bucket 文件夹复制到本地

Copy amazon s3 bucket folder to local

我有这个link:

s3://some_path/200_files/*.gz

我有对应的ACCESS IDSECRET KEY。如何复制完整文件夹(200_files)或所有.gz到本地系统?基于 Ubuntu CLIPython 的解决方案。我知道这不是一个合格的问题,评论中的答案会起作用。谢谢:)

To copy all objects in an S3 bucket to your local machine simply use the aws s3 cp command with the --recursive option.

参见:http://bigdatums.net/2016/09/04/copy-all-files-in-s3-bucket-to-local-with-aws-cli/

设置凭据:

mkdir ~/.aws
touch credentials

~/.aws/credentials(示例内容)

[default]
aws_access_key_id=AKIAIOSFODNN7EXAMPLE
aws_secret_access_key=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

更多配置here