简体   繁体   English

在 AWS S3 存储桶上组合 7z 块

[英]Combine 7z chunks on an AWS S3 Bucket

I have compressed a file into several chunks using 7zip:我使用 7zip 将一个文件压缩成几个块:

HAVE - the following saved in an AWS S3 Bucket:拥有 - 以下内容保存在 AWS S3 存储桶中:

pic.7z.001
pic.7z.002
pic.7z.003
pic.7z.004
pic.7z.005

Each chunk is 700 MB.每个块为 700 MB。

WANT - the following also saved in an AWS S3 Bucket:想要 - 以下内容也保存在 AWS S3 存储桶中:

first step: pic.7z
second step: a folder called 'pic'

I want to do it all on the AWS S3 if possible.如果可能的话,我想在 AWS S3 上全部完成。

How do I unzip and combine these chunks to get a single file using python?如何使用 python 解压缩并组合这些块以获取单个文件?

It's not possible to do this in S3, since S3 is only responsible for storage.在 S3 中不可能这样做,因为 S3 只负责存储。 You can do this in AWS lambda. You can invoke one lambda function per chunk and load the chunk into memory since the max disk space is only 512 MB for each function. Then initialize a multipart upload, and use the S3 multipart upload functionality to upload each chunk to S3.您可以在 AWS lambda 中执行此操作。您可以为每个块调用一个 lambda function 并将该块加载到 memory,因为每个 function 的最大磁盘空间仅为 512 MB。然后初始化分段上传,并使用 S3 分段上传功能上传每个块到 S3。 Finally, complete the multipart upload and S3 will automatically concatenate all the parts together into one 7z file.最后,完成分段上传,S3 会自动将所有分段拼接成一个 7z 文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM