Script to rotate backup files on AWS S3 according to a grandfather, father, son strategy.
Backup your files to Amazon Web Services in a way that slowly forgets! I’ve learned that this way is refered to as the [‘Grandfather, father, son’](http://en.wikipedia.org/wiki/Backup_rotation_scheme#Grandfather-father-son) strategy.
This script copies a file to Amazon S3 and rotates it.
The filename will have a date stamp added before the first . in the filename. Do not add a timestamp yourself, this will cause the script to treat the file as a unique file and the rotation won’t work!
Rotation works as follows: - Keep files from the last X days - After that, keep Y files spaced at least a week apart - After that, keep Z files spaced at least 30 days apart
pip install s3-backup-rotate
Export the following environment variables:
You can also use one of the other methods supported by boto.
upload_rotate.py bucket prefix file.
python upload_rotate.py -h for more info.
### Buidling Pypi package
python setup.py sdist twine upload dist/s3-backup-rotate-
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size s3-backup-rotate-0.3.3.tar.gz (5.0 kB)||File type Source||Python version None||Upload date||Hashes View hashes|