Git Product home page Git Product logo

s3_utilities's Introduction

Restoring buckets and directories from S3

This is a program that can quickly undelete files, folders, or entire buckets en masse from AWS S3 versioned buckets, which comes in handy if you accidentally delete something you wanted to keep. To use this program, your bucket must have versioning enabled.

Installing

  1. (optional) Make a virtual environment
  • pip install virtualenvwrapper
  • mkvirtualenv s3_utilities
  1. Install python requirements
  • pip install -r requirements.txt

Get help

./s3_undelete.py -h

To restore an entire bucket:

./s3_undelete.py -b some_test_bucket -u

To restore a directory within a bucket:

./s3_undelete.py -b some_test_bucket -f some\ test\ folder -u

To restore one object within a directory:

./s3_undelete.py -b some_test_bucket -k “some/test/file.jpg” -u

note: you must have the entire key name (including directories) in order to perform this operation.

To delete an object:

./s3_undelete.py -b some_test_bucket -k “some/test/file.jpg” -d

this will prompt the user to confirm before deleting

To delete a folder:

./s3_undelete.py -b some_test_bucket -f some\ test \folder -d

this will prompt the user to confirm before deleting each object within a directory

License

MIT License

Contributing

We welcome contributions. Contact me at [email protected] (or submit a pull request).

s3_utilities's People

Contributors

hollylemos avatar

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.