You can use the API to define lifecycle rules that archive files from Amazon S3 to the Amazon Glacier, and you can use the API to get a temporary copy of files archived to the glacier. However, you cannot use the API to tell Amazon S3 that certain files have been moved to the glacier.
There are two ways to use the Amazon Glacier:
- Directly through the Glacier API, which allows you to upload / download archives to / from glacier storages.
- Amazon S3 Lifecycle Guidelines that archive data from Amazon S3 into Amazon Glacier
Connecting directly through the Glacier API allows you to store archives for long-term storage, often used as a tape replacement. Data stored through the Glacier API must also be retrieved through the Glacier API. This is usually done with conventional enterprise backup software or even lightweight products such as Cloudberry Backup (Windows) or Arq (Mac).
Using Amazon S3 lifecycle rules allows you to store data in Amazon S3, and then define rules that determine when data should be archived for Glacier for long-term storage. For example, data can be archived 90 days after creation. Data transfer is governed by life cycle rules that operate on a daily basis. Rules can be set using the putBucketLifecycle API (available in the PHP SDK), but this only defines the rules — it is not possible to make an API call that tells S3 to archive specific files on Glacier.
Amazon S3 has a RestoreObject API (available in the PHP SDK) for restoring a temporary copy of data archived from the glacier back to S3. Please note that data recovery from the glacier takes 3-5 hours .
source share