我试图将所有文件从S3存储桶复制到VM中的本地文件夹,但出现以下错误:
warning: Skipping file s3://bucket/object. Object is of storage class GLACIER.
Unable to perform download operations on GLACIER objects. You must restore the
object to be able to perform the operation. See aws s3 download help for
additional parameter options to ignore or force these transfers.
要将文件从S3存储桶复制到本地文件夹,我使用了以下命令:
aws s3 cp s3://${s3Location} ${localDumpPath}
位置:
${s3Location}
=我的s3位置和${localDumpPath}
=我的本地文件夹路径要成功复制,我需要更改什么?
答案 0 :(得分:4)
我使用以下命令解决了该问题:
aws s3 cp s3://${s3Location} ${localDumpPath} --storage-class STANDARD --recursive --force-glacier-transfer
您还可以参考以下链接,以获取有关如何使用AWS CLI从Amazon S3 Glacier存储类还原S3对象的详细信息: Restore S3 object from the Amazon Glacier storage class
答案 1 :(得分:0)
问题:您正在尝试复制 aws s3 对象,但存储类型是冰川,并且出现以下错误:
warning: Skipping file s3://<SomePathToS3Object> Object is of storage class GLACIER.
Unable to perform download operations on GLACIER objects.
You must restore the object to be able to perform the operation.
See aws s3 download help for additional parameter options to ignore or force these transfers.
说明:Amazon S3 Glacier 是一种安全、持久且成本极低的云存储服务,用于数据归档和长期备份。当您需要使用您执行恢复请求的文件时,您支付检索价格,并且在几个小时后对象已启用并准备就绪。此功能通常使用公司在很少使用此数据时归档文件/日志/数据库/备份。
解决方案:为了获取冰川文件,您需要发起恢复请求,监控恢复请求的状态,一旦完成更改存储类的对象(标准)和复制它。您可以使用 aws reference
//Initate restore request:
$ aws s3api restore-object --bucket examplebucket --key dir1/example.obj \
--restore-request '{"Days":7,"GlacierJobParameters":{"Tier":"Standard"}}'
//monitor status:
$ aws s3api head-object --bucket examplebucket --key dir1/example.obj
// output example - restore in progress
{
"Restore": "ongoing-request=\"true\"",
...
"StorageClass": "GLACIER",
"Metadata": {}
}
// output example - restore completed
{
"Restore": "ongoing-request=\"false\", expiry-date=\"Sun, 1 January 2000 00:00:00 GMT\"",
...
"StorageClass": "GLACIER",
"Metadata": {}
}
$ aws s3 cp s3://examplebucket/dir1/ ~/Downloads \
--storage-class STANDARD --recursive --force-glacier-transfer