Skip to main content

Script to rotate backup files on AWS S3 according to a grandfather, father, son strategy.

Project description

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

## Installation

pip install s3-backup-rotate

## Usage

Export the following environment variables: - export AWS_ACCESS_KEY_ID=yourkeyidhere - export AWS_SECRET_ACCESS_KEY=yoursecretkey

You can also use one of the other methods supported by boto.

upload_rotate.py bucket prefix file.

See python upload_rotate.py -h for more info.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

s3-backup-rotate-0.3.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

s3_backup_rotate-0.3.0-py2.py3-none-any.whl (6.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file s3-backup-rotate-0.3.0.tar.gz.

File metadata

File hashes

Hashes for s3-backup-rotate-0.3.0.tar.gz
Algorithm Hash digest
SHA256 60cd0f22ed0d30044049db2d7a9a9cd1784eabc622f5960917ffb4e3ca7648a6
MD5 60dc51716e23ae66f03ffccbd17639ab
BLAKE2b-256 6ad35c2699e97c96144caecbb688a8e6d7e9d2c8259ecce5b412dedc0225edbb

See more details on using hashes here.

File details

Details for the file s3_backup_rotate-0.3.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for s3_backup_rotate-0.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0ee0844bd9fe7e9904573d092b686b6a6f92f1107e582aaf9b0a31cdce979492
MD5 3768d6339eacb9f6262505955ac702e8
BLAKE2b-256 0a3e4594a1ace741795c467d9295698f49d5c03e62748e54d561455439fe5fbe

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page