Giter Club home page Giter Club logo

glacier-utils's Introduction

glacier-utils

a few tools I threw together to be able to archive directories to Amazon Glacier

tree-hash

a bash implementation of their tree-hash algorithm.

Usage:

tree-hash [-b] filename

  -b  print the output hash in binary form

tree-hash contains 2 "subcommands" that can be run individually:

tree-hash-reduce

Implements the 'merge level' portion of the tree hash algorithm. Given a starting directory of leaf nodes, will combine 2 hashes at a time, and repeat this process until only 1 hash is left over.

Usage:

tree-hash-reduce directory

A common task is building the root treehash from a list of subnode hashes. This is implemented in the tree-hash command as:

mkdir -p hashes
cp hash.* hashes
tree-hash-reduce hashes
xxd -ps -c 100 "hashes/$(/bin/ls -1 hashes | head -n 1)"

tree-hash-combine

Almost never need to run this directly.

Takes 2 binary hash files (left-file and right-file), concatenates the values together and sha256 hashes the result. The resulting hash is written back to left-file and right-file is deleted.

Usage:

tree-hash-combine left-file right-file

glacier-archive

Archives a directory to Amazon Glacier.

Usage:

glacier-archive dirname

glacier-archive-prepare

Prepares a directory for archiving:

  1. creates an archive.$dirname sidecar directory that holds the prepared data
  2. tar the directory and split the result into equally sized chunks
  3. run tree-hash on each chunk
  4. run tree-hash-reduce on the resulting hashes to get the tree-hash of the whole archive

Usage:

glacier-archive-prepare dirname

glacier-archive-upload

Uploads a directory (after running Glacier-archive-prepare to Glacier using the multi-part uploader. After uploading, autotags the original (unprepared) directory with the metadata returned from the Glacier API.

Usage:

glacier-archive-upload dirname

Note: glacier-archive-upload should take the same dirname argument as glacier-archive-prepare and not the prepared archive.* directory.

glacier-utils's People

Contributors

joechrz avatar

Watchers

James Cloos avatar

glacier-utils's Issues

keep central repo of archives

each time a directory is archived, update a ~/.glacier-archives file with the path to the original directory and a copy of the upload metadata

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.