Archiving data to AWS Glacier

For archiving your data at AWS you can use AWS Glacier. This service offers cheaper storage than the S3 service but the downside is that your data won’t be accessible right away as it is with S3. It may take a few hours to restore the data but if you are using this service for real archiving purposes this shouldn’t be a real issue. Lets setup a Glacier Vault by using the Management Console. Select the Glacier service in the Management Console:
Screen Shot 2013-05-14 at 14.11.08
Click ‘Create Vault’ and give it a name:
Screen Shot 2013-05-14 at 14.11.40
Set up a new SNS topic so we can receive messages when archiving actions are finished.
Screen Shot 2013-05-14 at 14.12.44
If all went well the Vault is created:
Screen Shot 2013-05-14 at 14.12.58
Together with the vault also a new SNS is created. To receive the messages posted on the SNS lets subscribe to it. Select the SNS service in the console:
Screen Shot 2013-05-14 at 14.25.22
Select the SNS topic that is just created:
Screen Shot 2013-05-14 at 14.26.25
Now click on the button to create a subscription to this topic. I simply create an email subscription so every message posted on the topic is send to the supplied email address:
Screen Shot 2013-05-14 at 14.58.47

The Glacier service in the Management Console doesn’t come with the functionality to archive/restore files to and from Glacier (like it does with S3). But there is of course an API to use and several SDK’s to transfer files. And of course there is the community which jumped into this and created a lot of tools both GUI and CLI based. I just picked one of them and installed it.
After installing and configuring the Glacier-cli I can check the created vault is found:

pascal$ ./ --region eu-west-1 vault list

Lets put some data into the vault. I use the example of the CLI tool as inspiration. Create a local file:

pascal$ echo 42 > example.txt

Upload the file into the vault created earlier:

pascal$ ./ --region eu-west-1 archive upload PascalBackuPVault example.txt

Lets check the file is in the vault:

pascal$ ./ --region eu-west-1 archive list PascalBackuPVault

Now remove the local file and restore the archived one:

pascal$ rm example.txt
pascal$ ./ --region eu-west-1 archive retrieve PascalBackuPVault example.txt
glacier: queued retrieval job for archive 'example.txt'
pascal$ ./ --region eu-west-1 archive retrieve PascalBackuPVault example.txt
glacier: job still pending for archive 'example.txt'
pascal$ ./ --region eu-west-1 job list
a/p 2013-05-20T18:40:25.107Z PascalBackuPVault example.txt
pascal$ ./ --region eu-west-1 archive retrieve --wait PascalBackuPVault example.txt

After a few hours the job is finished and we can access the local file ‘example.txt’ again.

pascal$ cat example.txt

And in the mail I find the following notification telling me the archive file is ready for retrieval:


There is of course a lot more to tell about AWS Glacier. This page will be a good next step to get familiair with Glacier.

About Pascal Alma

Pascal is a senior IT consultant and has been working in IT since 1997. He is monitoring the latest development in new technologies (Mobile, Cloud, Big Data) closely and particularly interested in Java open source tool stacks, cloud related technologies like AWS and mobile development like building iOS apps with Swift. Specialties: Java/JEE/Spring Amazon AWS API/REST Big Data Continuous Delivery Swift/iOS
This entry was posted in AWS, cloud and tagged , , . Bookmark the permalink.

2 Responses to Archiving data to AWS Glacier

  1. Pingback: Archiving your S3 content | The Pragmatic Integrator

Comments are closed.