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.2.tar.gz (4.9 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for s3-backup-rotate-0.3.2.tar.gz
Algorithm Hash digest
SHA256 a89ba8ee5c0d620bf0535f7ff5699a22e9101c3c00aa3d0b1554cb4359da9351
MD5 ceed6f0879fd52169bba2b5816053984
BLAKE2b-256 e623c46d5380fa0cb58c9872dfbb2d3c41cb21ef40f1bf797b663a9ddaa36816

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