从S3 Glacier Flexible Retrieval中恢复和同步文件

0

【以下的问题经过翻译处理】 我有两个AWS账户,账户A和账户B。账户A在S3 Glacier Flexible Retrieval(05 buckets)上归档了30 TB的信息。我需要将这些信息移动到账户B的S3标准存储中。

我正在尝试以下步骤:

  1. 首先,使用以下命令从S3 Glacier中恢复对象(每次一个桶):
aws s3 ls s3://bucket1 --recursive  | awk '{print $4}' | xargs -L 1 aws s3api restore-object --restore-request '{"Days":10,"GlacierJobParameters":{"Tier":"Standard"}}' --bucket bucket1 --key

  1. 使用以下命令在账户之间同步从恢复的桶中还原的信息。我在账户B上创建了名为restored-bucket1的S3桶,并对其应用了所有必需的权限策略。
aws s3 sync s3://bucket1 s3:restored-bucket1

即使S3控制台显示信息已经恢复

Object: Amazon S3 > Buckets > Bucket1 > file1.png
Restoration status
Completed
Restoration expiry date
January 14, 2023, 21:00:00 (UTC-03:00)

我仍然收到错误提示:

warning: Skipping file s3://bucket1/file1.png . 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.

我已经设定并运行所有允许账户之间文件传输的策略,并且可以轻松同步不在Glacier中的其他信息。

profile picture
专家
已提问 5 个月前22 查看次数
1 回答
0

【以下的回答经过翻译处理】 你想要执行的命令是aws s3 sync s3://bucketname1 s3://bucketname2 --force-glacier-transfer --storage-class STANDARD

这里有一个已知问题 - https://github.com/aws/aws-cli/issues/1699

基本上,在进行还原时,CLI仍然认为它是一个已归档的对象。上述命令将强制进行同步,并不会启动新的还原。

profile picture
专家
已回答 5 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则