如何找到数据来源? [英] How to find the origin of data?

查看:119
本文介绍了如何找到数据来源?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

到目前为止,文件只是像以下那样单独下载,而不是全部压缩在一个压缩文件中:

So far the files are just being downloaded individually like the following rather than all being in one zipped file:

s3client = boto3.client('s3')

t.download_file("firstbucket",obj ['Key'],文件名)

t.download_file(‘firstbucket’, obj['Key'], filename)

推荐答案

如果要使用boto,则必须像您一样循环执行,并将每个项目添加到zip文件中.

if you want to use boto you'll have to do it in a loop like you have and add each item to a zip file.

使用CLI可以使用s3 sync,然后将其压缩 https://docs.aws.amazon.com/cli/Latest/reference/s3/sync.html

with the CLI you can use s3 sync and then zip that up https://docs.aws.amazon.com/cli/latest/reference/s3/sync.html

aws s3 sync s3://bucket-name ./local-location && zip bucket.zip ./local-location

这篇关于如何找到数据来源?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆