...
Initiate a Restore Request:
Code Block language bash aws s3api restore-object --bucket YOUR_BUCKET_NAME --key YOUR_FILE_KEY --restore-request Days=NUMBER_OF_DAYS_TO_KEEP_RESTORED,GlacierJobParameters={Tier="STANDARD"}
Replace
YOUR_BUCKET_NAME
with the name of your bucket.Replace
YOUR_FILE_KEY
with the S3 key of the file you want to restore.Replace
NUMBER_OF_DAYS_TO_KEEP_RESTORED
with the number of days you want to keep the restored copy available for. After this time period, the temporary copy will be deleted, but the original in Glacier Deep Archive remains.
Check the Restoration Status:
It typically takes about 12 hours for the restoration process to complete. To check the status:Code Block language bash aws s3api head-object --bucket YOUR_BUCKET_NAME --key YOUR_FILE_KEY
In the output, look for the
"Restore"
field. When the file is ready, it'll state"ongoing-request": "false"
.Retrieve the Restored File:
After restoration completes:Code Block language bash aws s3 cp s3://YOUR_BUCKET_NAME/YOUR_FILE_KEY DESTINATION_PATH_ON_YOUR_LOCAL_MACHINE
Replace
DESTINATION_PATH_ON_YOUR_LOCAL_MACHINE
with where you want to download the file to.
Remember, you're You are only billed for the restored copy of the file for the number of days you specified in the restore request. After those days, the temporary restored copy will be deleted, but the original in the Glacier Deep Archive will remain intact.
...