1

Info about my bucket and the object

s3cmd info s3://$BUCKET/
s3://$BUCKET/ (bucket):
   Location:  eu-central-1
   Payer:     BucketOwner
   Expiration Rule: all objects in this bucket will expire in '
   policy:    none
   cors:      none
   ACL:       76b81345345erfrefge473b9c6ac3c7238ceab39fddef698645c5076a41: FULL_CONTROL

s3cmd info s3://$BUCKET/$DIR/$FILE
s3://$BUCKET/$DIR/$FILE (object):
   File size: 21927
   Last mod:  Tue, 21 Jun 2016 08:41:03 GMT
   MIME type: binary/octet-stream
   Storage:   GLACIER
   MD5 sum:   f55ff37a27b83c96b8a492d3d3dbb904
   SSE:       none
   policy:    none
   cors:      none
   ACL:       76b81e6138c136e4c7e42d75773sferwf4345egrb39fddef698645c5076a41: FULL_CONTROL
   x-amz-meta-s3cmd-attrs: uid:503/gname:staff/uname:john/gid:20/mode:33261/mtime:1311191701/atime:1466282917/md5:f55ff37a27b83c96b8a492d3d3dbb904/ctime:1436192978
   x-amz-meta-s3tools-gpgenc: gpg

Restore from Glacier:

> s3cmd restore s3://$BUCKET/$DIR/$FILE
restore: 's3://$BUCKET/$DIR/$FILE'

And finally download the object to my Desktop

> s3cmd get s3://$BUCKET/$DIR/$FILE /Users/john/Desktop/                                                      
download: 's3://$BUCKET/$DIR/$FILE' -> '/Users/john/Desktop/$FILE’  [1 of 1]
ERROR: S3 error: 403 (Forbidden)

I receive 403. I use the same credentials for download like for upload two months ago.

Sybil
  • 2,503
  • 3
  • 25
  • 36
  • Did you wait at least 4 hours between `restore` and `get`? If not, `403 Forbidden` would be the expected response, with `InvalidObjectState`. What's the rest of the error? – Michael - sqlbot Aug 08 '16 at 23:36
  • @Michael-sqlbot You are right. Thank you very much. – Sybil Aug 09 '16 at 08:10

1 Answers1

1

From Glacier FAQ

Data Retrievals

Q: How can I retrieve data from the service?

You can download data directly from the service using the service’s REST API. When you make a request to retrieve data from Glacier, you initiate a retrieval job. Once the retrieval job completes, your data will be available to download for 24 hours. Retrieval jobs typically complete within 3-5 hours.

Q: What operations initiate jobs and why?

To retrieve an archive or a vault inventory, you first initiate a job (Click here for more information about vault inventories). Once you initiate a job, you can call the DescribeJob API to monitor its progress. You can also have notifications automatically sent to you once a job completes. Jobs will typically complete in 3-5 hours. Once a job completes successfully, you can download the data requested or access it using Amazon Elastic Compute Cloud (Amazon EC2).

Q: How long does it take for jobs to complete?

Most jobs will take between 3 to 5 hours to complete.

Today the restore was successful

s3cmd get s3://$BUCKET/$DIR/$FILE /Users/john/Desktop/
download: 's3://$BUCKET/$DIR/$FILE' -> '/Users/john/Desktop/$FILE  [1 of 1]
 21927 of 21927   100% in    0s    24.66 kB/s  done

The file was not encrypted on my Desktop. I used -e, --encrypt Encrypt files before uploading to S3 option for uploading to S3/Glacier.

There are APIs for monitoring retrievals.

Job Operations

The following are the job operations available in Amazon Glacier.

Topics

Describe Job (GET JobID)
Get Job Output (GET output)
Initiate Job (POST jobs)
List Jobs (GET jobs)
Sybil
  • 2,503
  • 3
  • 25
  • 36