Home » Centos/RHEL » How to setup and configure Amazon Glacier on linux server

How to setup and configure Amazon Glacier on linux server

Amazon Glacier is a cost effective online file storage service that provides secure, reliable and stable online storage for data archiving backup solution. Amazon Glacier keeps the backup data archive on different and multiple devices that increase the reliability and security of data.
This article will describe you that how to setup and configure the Amazon Glacier on linux system/server.

First of all glaicer-cmd tool that provide the command line management tool for amazon vaut. Steps are given below.

[root@linuxpcfix ~]# cd /usr/local/src
[root@linuxpcfix ~]# git clone git://github.com/uskudnik/amazon-glacier-cmd-interface.git
[root@linuxpcfix ~]# ls -la
[root@linuxpcfix ~]# cd amazon-glacier-cmd-interface/
[root@linuxpcfix ~]# ls -la
[root@linuxpcfix ~]# python setup.py install
[root@linuxpcfix ~]# glacier-cmd –help

Now install the boto on the server

[root@linuxpcfix ~]# cd /usr/local/src
[root@linuxpcfix ~]# git clone git://github.com/boto/boto.git
[root@linuxpcfix ~]# cd boto/
[root@linuxpcfix ~]# python setup.py install

Once installation process get completed, Create vault configuration file and append the following lines as given below.

[root@linuxpcfix ~]# vi ~/glacier-cmd

[aws]
aws_access_key=put your access key
aws_secret_key=put your secret key

[glacier]
region=us-east-1
logfile=~/.glacier-cmd.log
loglevel=INFO
output=print

Create vault as given below

[root@linuxpcfixix ~]# glacier-cmd mkvault “my-first-vault|”
+———–+————————————————-+
| Header | Value |
+———–+————————————————-+
| RequestId | pqS62WYUvbvoahU-XwYchQgM9SJJQaLl2Zd2h6N |
| Location | /136538653411/vaults/my-first-vault |
+———–+————————————————-+
[root@linuxpcfixix ~]#

After that verify the aws console now vault should be listed in your aws console management under Glacier catogery.
Finally To upload archive use “upload” sub command You can upload data from file or data from stdin. To upload from file:

[root@linuxpcfixix ~]# glacier-cmd upload my-first-vault /home/user/backup.tar.gz –descript
ion “The file description”
Wrote 169.6 MB. Rate 4.19 MB/s.%). Rate 5.39 MB/s, average 4.22 MB/s, ETA 02:42:45.
+————————–+——————————————————————+
| Header | Value |
+————————–+——————————————————————+
| Archive SHA256 tree hash | 2410b4f87516a4e06e68b61ea49cdeed985c8af7551bb4e3ec02393f4e76c5a6 |
| Uploaded file | /home/user/backup.tar.gz |
+————————–+——————————————————————+
[root@linuxpcfixix ~]#

Download and Retrieve the archive from storage.
The following command will start a job retrieving the archive and this request will take fours hours to complete.

[root@linuxpcfixix ~]# glacier-cmd getarchive my-first-vault archive-ID

Then download the data.

[root@linuxpcfixix ~]# glacier-cmd download my-first-vault archive-ID

If you want to DELETE an archive then execute the following command.

[root@linuxpcfixix ~]# glacier-cmd rmarchive my-first-vault archive-ID

Listing available vaults.

[root@linuxpcfixix ~]#glacier-cmd lsvault
+——+———————————————————————+————————–+———————–+
| Size | ARN | Created | Vault name |
+——+———————————————————————+————————–+———————–+
| 0 | arn:aws:glacier:us-east-1:136538653411:vaults/my-first-vault| 2015-01-01T07:14:00.781Z | my-first-vault|
+——+———————————————————————+————————–+———————–+
[root@linuxpcfix ~]#

Verify the Vault status

[root@linuxpcfixix ~]#glacier-cmd describevault my-first-vault
200 OK
+————————–+———-+———-+—————————————————-+————————–+
| LastInventory | Archives | Size | ARN | Created |
+————————–+———-+———-+—————————————————-+————————–+
| 2015-01-01T20:14:31.609Z | 19 | 44782465 | arn:aws:glacier:us-east-1:881745379619:vaults/my-first-vault | 2014-12-31T03:26:05.507Z |
+————————–+———-+———-+—————————————————-+————————–+

To delete a vault

[root@linuxpcfixix ~]# glacier-cmd rmvault my-first-vault

To List an inventory of a vault
As amazon Glacier does not make inventory of a vault automatically it does only on request if there is no inventory available, this command shall initiate
an inventory retrieval job, which generally takes about three/four hours to complete.

root@linuxpcfixix ~]#glacier-cmd inventory my-first-vault

To list the jobs

[root@linuxpcfixix ~]# glacier-cmd listjobs my-first-vault

The following command will provide more information of a specific job such as when the specific job was created and what is the current status.

[root@linuxpcfixix ~]# glacier-cmd describejob my-first-vault

That’s it.

About

I am founder and webmaster of www.linuxpcfix.com and working as a Sr. Linux Administrator (Expertise on Linux/Unix & Cloud Server) and have been in the industry since more than 14 years.

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*

Time limit is exhausted. Please reload the CAPTCHA.

Categorized Tag Cloud