Back up using amazon-glacier-cmd-interface
$ pip install boto
~/.boto
[Credentials]
aws_access_key_id = YOURACCESSKEY
aws_secret_access_key = YOURSECRETKEY
$ git clone https://github.com/uskudnik/amazon-glacier-cmd-interface
$ cd amazon-glacier-cmd-interface
$ python setup.py install
Glacier manages files by ID, so you don't know which ID is which file.
Therefore, use SimpleDB to associate the file name with the ID.
Since SimpleDB is only operated from API, create a domain from a script
create_sdb_domain.py
#!/usr/bin/env python
# coding: utf-8
import boto.sdb
def main():
conn = boto.sdb.connect_to_region('ap-northeast-1')
if conn is None:
#If None, the region name is misconfigured.
print 'Invalid Region.'
return
# "jp.mursts.sdb.glacier_backup"Create a domain named
conn.create_domain('jp.mursts.sdb.glacier_backup')
print conn.get_all_domains()
if __name__ == '__main__':
main()
$ create_sdb_domain.py
~/.glacier-cmd
[aws]
access_key=YOURACCESSKEY
secret_key=YOURSECRETKEY
[glacier]
region=ap-northeast-1 #Tokyo region
bookkeeping=True
bookkeeping-domain-name=jp.mursts.sdb.glacier_backup #SimpleDB domain name
logfile=~/.glacier-cmd.log
loglevel=INFO
output=print
Create a Vault with the name "Test"
$ glacier-cmd mkvault Test
$ glacier-cmd upload Test /path/to/archive
Here, the information saved in SimpleDB is acquired.
$ glacier-cmd search Test
Recommended Posts