Downloading an entire S3 bucket?

前端 未结 30 1452
天命终不由人
天命终不由人 2020-11-29 14:10

I noticed that there doesn\'t seem to be an option to download an entire S3 bucket from the AWS Management Console.

Is there an easy way to grab everything in one of

30条回答
  •  臣服心动
    2020-11-29 14:52

    The answer by @Layke is good, but if you have a ton of data and don't want to wait forever, you should read "AWS CLI S3 Configuration".

    The following commands will tell the AWS CLI to use 1,000 threads to execute jobs (each a small file or one part of a multipart copy) and look ahead 100,000 jobs:

    aws configure set default.s3.max_concurrent_requests 1000
    aws configure set default.s3.max_queue_size 100000
    

    After running these, you can use the simple sync command:

    aws s3 sync s3://source-bucket/source-path s3://destination-bucket/destination-path
    

    or

    aws s3 sync s3://source-bucket/source-path c:\my\local\data\path
    

    On a system with CPU 4 cores and 16GB RAM, for cases like mine (3-50GB files) the sync/copy speed went from about 9.5MiB/s to 700+MiB/s, a speed increase of 70x over the default configuration.

提交回复
热议问题