GithubHelp home page GithubHelp logo

s3_downloader's Introduction

s3_downloader

simple python script that downloads all the files from an s3 bucket that are not in 'glacier'

It follows this simple process:

  1. Get an iterator for the keys in the bucket
  2. Step through each key
  3. If the key has a storage_class of GLACIER, skip it
  4. If the key already exists as a file in the to_download directory, skip it
  5. Print the key name
  6. Download the contents of the object to a file named after the key in the to_download directory

SETUP

Using virtualenv is strongly recommended

pip install boto
pip install pyyaml

Edit config.yml to taste.

MOTIVATION

Why?
Well, why not?
No, but seriously, why?

I have a raspberry pi that I use to capture timelapses of things like snow accumulating out of the window. The pi has a script which uploads the timelapses (and the jpgs that make them up) to an s3 bucket. After some number of days, the objects are automatically transitioned to GLACIER using a lifecycle rule.

At some point I wanted to download all of the images that were not in glacier yet (say, the timelapses from the last week or so). This would have been more painful to do manually than to whip up in python. I mean, why does anyone ever write a script? =p

s3_downloader's People

Contributors

andrewbudd avatar

Stargazers

 avatar

Forkers

msgendev

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.