AWS Glacier

Thu 27 February 2014 by Patrick Pierson

I needed a way to backup some client data, securely, and without the need to maintain a server at home. I recently heard about Glacier through work for our disaster recovery stuff and thought “why not?”. Glacier is cheap and relatively easy to work with. Costs are 1cent per GB per month, however the catch is you have to commit to storing it for 3 months and if you want to retrieve the data it will take 3-5 hours. I figured I was ok with spending at least 3cents on the off chance I’ll need this data.

Setup was super easy. I am running CentOS 6.5 with python 2.6.6 and pip installed.

Run the command:

pip install awscli

Once that finishes generate your security credentials on Amazon. You can find it under Security Credentials > Access Keys. Or under Users > Select the user you want (or create a new one) > Security Credentials > manage Access Keys > Create Access Key Once that is done make sure you add the permission “AmazonGlacierFullAccess” if you do not have Administrator access you will have to have someone add it for you that does.

Go back to your commandline and create to files (I setup both because the .boto file is needed for glacier, but the .aws-config seems to be needed for others, either way if you make both you are ok). This files go in your home directory. Create a .boto file and add the following:

[Credentials]
aws_access_key_id=#########################
aws_secret_access_key=###############################
region=#######

Also create a .aws-config file and add the following:

[default]
aws_access_key_id=#########################
aws_secret_access_key=###############################
region=#######

The only difference is the Credentials and default line, everything else is the same.

Test your glacier access by running:

glacier vaults

You will see any vaults you already created or none.

arn:aws:glacier:##-####-1:################:vaults/backup

To upload a file run:

glacier upload "vault_name" "file_name"

It will take time to upload and then time to update on the Glacier page but you will know its done when you see the number of archives update.