Restore object from AWS Glacier to S3

1.1k views Asked by At

I have configured life cycle policy in S3, some of objects in S3 are stored in Glacier class, some of object are still in S3, now I am trying to restore objects from Glacier, I can get object list in S3 by java AWS SDK, how can I know which object is in Glacier storage by AWS SDK? The reason is when I try restore an object not in Glacier, I will have a exception. I wanna avoid this.

2

There are 2 answers

0
John Rotenstein On BEST ANSWER

The ListObjects Amazon S3 API call can be used to obtain a list of objects in a given bucket.

The list of files returned includes a StorageClass field. It can be one of:

  • STANDARD
  • REDUCED_REDUNDANCY
  • GLACIER

The GLACIER storage class indicates that the contents of the object is currently in Glacier.

0
Shekhar On

Restore Data from AWS Glacier to S3 Bucket:

  1. Connect to any AWS EC2 Instance
  2. Install S3CMD on EC2
  3. s3cmd restore --restore-days=10 --recursive s3://bucketName/

Note : restore-days=10 --->Data will be available for next 10 days after it will return back to Glacier.