相关疑难解决方法(0)

Amazon S3 boto - 如何创建文件夹?

如何使用botoAmazon s3的库在存储桶下创建文件夹?

我按照手册,创建了具有权限,元数据等的密钥,但没有在boto的文档中描述如何在存储桶下创建文件夹,或在存储桶中的文件夹下创建文件夹.

amazon-s3 boto

114
推荐指数
7
解决办法
10万
查看次数

复制到大型目录时,AWS S3 Sync非常慢

使用AWS-CLI将数据同步到S3中的空目录时,几乎是即时的.但是,当同步到一个大目录(几百万个文件夹)时,甚至需要很长时间才能开始上传/同步文件.

有替代方法吗?看起来它试图在同步之前考虑S3目录中的所有文件 - 我不需要它,并且在没有事先检查的情况下上传数据就没问题了.

amazon-s3 bigdata amazon-web-services aws-cli

14
推荐指数
2
解决办法
6623
查看次数

使用 boto3 列出 AWS S3 文件夹

我有 boto 代码,用于收集 levelOne 文件夹中的 S3 子文件夹:

import boto

s3 = boto.connect_s3()
bucket = s3.get_bucket("MyBucket")

for level2 in bucket.list(prefix="levelOne/", delimiter="/"):
    print(level2.name)
Run Code Online (Sandbox Code Playgroud)

请帮助发现 boto3 中的类似功能。该代码不应迭代所有 S3 对象,因为存储桶中的对象数量非常大。

python directory amazon-s3 boto boto3

10
推荐指数
2
解决办法
2万
查看次数

如何在 Python 中使用线程来并行化 AWS S3 API 调用?

我编写了一个 Python 脚本,试图通过使用AWS Boto 3 list_objects() 方法来确定所有可用 AWS S3 存储桶的总大小。

逻辑很简单:

  1. 从每个 S3 存储桶中获取对象的初始列表(在 1,000 个对象后自动截断)
  2. 遍历对象列表中的每个对象,将该对象的大小添加到 total_size 变量中
  3. 当存储桶仍有其他对象时,检索它们并重复步骤 2

这是相关的代码片段:

import boto3

s3_client = boto3.client('s3')

# Get all S3 buckets owned by the authenticated sender of the request
buckets = s3_client.list_buckets()

# For each bucket...
for bucket in buckets['Buckets']:
    # Get up to first 1,000 objects in bucket
    bucket_objects = s3_client.list_objects(Bucket=bucket['Name'])

    # Initialize total_size
    total_size = 0

    # Add size of each individual item in bucket …
Run Code Online (Sandbox Code Playgroud)

python concurrency multithreading amazon-s3 amazon-web-services

5
推荐指数
2
解决办法
4186
查看次数

Download Entire Content of a subfolder in a S3 bucket

I have a bucket in s3 called "sample-data". Inside the Bucket I have folders labelled "A" to "Z".

Inside each alphabetical folder there are more files and folders. What is the fastest way to download the alphabetical folder and all it's content?

For example --> sample-data/a/foo.txt,more_files/foo1.txt

In the above example the bucket sample-data contains an folder called a which contains foo.txt and a folder called more_files which contains foo1.txt

I know how to download a single file. For instance if …

python amazon-s3 amazon-web-services python-3.x boto3

2
推荐指数
1
解决办法
2763
查看次数