您能否在使用 AWS CLI 后从 S3 解压缩文件并将解压缩的版本推回 S3?
尝试以下,还没有成功。
unzip aws s3 cp https://aws-lake/test/test.zip
您能否在使用 AWS CLI 后从 S3 解压缩文件并将解压缩的版本推回 S3?
尝试以下,还没有成功。
unzip aws s3 cp https://aws-lake/test/test.zip
您至少需要执行三个操作:
# Download the zip file from S3, note the use of the S3 URI, not HTTPS
aws s3 cp s3://aws-lake/test/test.zip temp.zip
# Decompress the zip file into a temp directory
unzip -d temp_zip_contents temp.zip
# Sync up the contents of the temp directory to S3 prefix
aws s3 sync temp_zip_contents s3://aws-lake/test/test_contents
# And optionally, clean up the temp files and directory
# Unix:
rm -rf temp.zip temp_zip_contents
# Windows
rd /s/q temp_zip_contents
del temp.zip
可以编写一个程序来将文件下载到内存中,读取 zip 文件的内容,然后上传解压后的单个文件,但这需要的命令行命令并不多。