[PYTHON] I tried using Amazon Glacier

Back up using amazon-glacier-cmd-interface

install boto

$ pip install boto

Create a configuration file for use with boto

~/.boto


[Credentials]
aws_access_key_id = YOURACCESSKEY
aws_secret_access_key = YOURSECRETKEY

Install amazon-glacier-cmd-interface

$ git clone https://github.com/uskudnik/amazon-glacier-cmd-interface
$ cd amazon-glacier-cmd-interface
$ python setup.py install

Create an Amazon SimpleDB domain

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

Create a configuration file for use with amazon-glacier-cmd-interface

~/.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

Create a Vault with the name "Test"

$ glacier-cmd mkvault Test

Upload file

$ glacier-cmd upload Test /path/to/archive

View the list of uploaded archives

Here, the information saved in SimpleDB is acquired.

$ glacier-cmd search Test

Recommended Posts

I tried using Amazon Glacier
I tried using parameterized
I tried using argparse
I tried using mimesis
I tried using Amazon SQS with django-celery
I tried using anytree
I tried using Summpy
I tried using coturn
I tried using Pipenv
I tried using matplotlib
I tried using "Anvil".
I tried using Hubot
I tried using ESPCN
I tried using openpyxl
I tried using Ipython
I tried using PyCaret
I tried using cron
I tried using ngrok
I tried using face_recognition
I tried using Jupyter
I tried using PyCaret
I tried using Heapq
I tried using doctest
I tried using folium
I tried using jinja2
I tried using folium
I tried using time-window
[I tried using Pythonista 3] Introduction
I tried using easydict (memo).
I tried face recognition using Face ++
I tried using Random Forest
I tried using BigQuery ML
I tried using git inspector
[Python] I tried using OpenPose
I tried using magenta / TensorFlow
I tried using AWS Chalice
I tried using Slack emojinator
I tried using Rotrics Dex Arm # 2
I tried using Rotrics Dex Arm
I tried using GrabCut of OpenCV
I tried using Thonny (Python / IDE)
I tried server-client communication using tmux
I tried reinforcement learning using PyBrain
I tried deep learning using Theano
Somehow I tried using jupyter notebook
[Kaggle] I tried undersampling using imbalanced-learn
I tried shooting Kamehameha using OpenPose
I tried using the checkio API
[Python] I tried using YOLO v3
I tried asynchronous processing using asyncio
I tried scraping
I tried PyQ
I tried playing a ○ ✕ game using TensorFlow
I tried using YOUTUBE Data API V3
I tried using Selenium with Headless chrome
I tried drawing a line using turtle
I tried using Bayesian Optimization in Python
I tried to classify text using TensorFlow
I tried using Selective search as R-CNN
I tried AutoKeras
I tried using UnityCloudBuild API from Python