是否可以在 Amazon S3 上压缩目录而不是下载 ->拉链 ->上传 [英] Is it possible to zip a directory on Amazon S3 instead of download -> zip -> upload

查看:25
本文介绍了是否可以在 Amazon S3 上压缩目录而不是下载 ->拉链 ->上传的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将我的所有文件保存在 Amazon S3 上,并且只根据需要压缩目录,而不是需要从 S3 下载所有文件,将其压缩,然后将压缩文件上传到 S3.

I would like to keep all of my files on Amazon S3, and just zip directories as I need to, instead of needing to download all the files from S3, zip it, and then upload the zip to S3.

目前我下载我的文件并将其压缩以上传.我在搜索此问题时没有发现任何内容.

Currently I download my files and zip it to upload. I haven't found anything when searching for this issue.

推荐答案

Amazon S3 是一种对象存储服务.它没有压缩文件的能力.

Amazon S3 is an object storage service. It does not have the ability to zip files.

您需要下载、压缩、上传文件.这可以在 Amazon EC2 实例上或通过 AWS Lambda 完成.

You would need to download, zip, upload the files. This could be done on an Amazon EC2 instance or via AWS Lambda.

AWS Lambda 提供无服务器计算,这意味着您只需提供代码和激活触发器,代码就会运行.它实际上只是一个运行代码的短期容器.

AWS Lambda provides serverless compute, which means you simply need to provide the code and an activation trigger, and the code will run. It's actually just a short-lived container that runs the code.

但是,AWS Lambda 函数只有 500MB 的存储空间,因此您需要确保这足以存储原始文件和 zip 文件.确保 Lambda 函数在执行后删除这些文件,因为 Lambda 环境可以在以后的执行中重复使用.

However, AWS Lambda functions only have 500MB of storage space, so you would need to ensure that this is sufficient to store the original files and the zip file. Make sure the Lambda function deletes these files after execution because the Lambda environment can be reused for future executions.

AWS Lambda 可以使用多种不同的编程语言(例如 Python、Node、.Net).如果您已获得使用权限,它始终在 AWS 上可用.

AWS Lambda can use many different programming languages (eg Python, Node, .Net). It is always available on AWS, if you have been granted permission to use it.

见:

  • carloscarcamo/aws-lambda-unzip-py: AWS Lambda function to extract zip files uploaded to S3 (Unzip rather than zip, but it is a good example)

这篇关于是否可以在 Amazon S3 上压缩目录而不是下载 ->拉链 ->上传的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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