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.
- (optional) Make a virtual environment
pip install virtualenvwrapper
mkvirtualenv s3_utilities
- Install python requirements
pip install -r requirements.txt
./s3_undelete.py -h
./s3_undelete.py -b some_test_bucket -u
./s3_undelete.py -b some_test_bucket -f some\ test\ folder -u
./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.
./s3_undelete.py -b some_test_bucket -k “some/test/file.jpg” -d
this will prompt the user to confirm before deleting
./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
MIT License
We welcome contributions. Contact me at holly@metabrite.com (or submit a pull request).