Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Script backups easily to Amazon S3

Project Description

avoid_disaster

Avoid Disaster can be used to script daily, weekly or monthly backups and upload them to S3.

For more information check out: http://amix.dk/blog/post/19529#Avoid-Disaster-Script-backups-easily-to-Amazon-S3

Examples

Example of creating a backups of test_dir/:

import os
from avoid_disaster import S3Uploader, gunzip_dir, generate_file_key

#--- Globals ----------------------------------------------
AWS_KEY = 'YOUR AWS KEY'
AWS_SECRET = 'YOUR AWS SECRET'

s3_uploader = S3Uploader(AWS_KEY,
                         AWS_SECRET,
                         'backups.your_domain.com')

#--- Easy usage ----------------------------------------------
#Daily
s3_uploader.compress_and_upload('test_dir/',
                                'test_dir.%(weekday)s.tgz',
                                replace_old=True)

#Monthly
s3_uploader.compress_and_upload('test_dir/',
                                'test_dir.%(month_name)s.tgz',
                                replace_old=True)

#Weekly
s3_uploader.compress_and_upload('test_dir/',
                                'test_dir.%(week_number)s.tgz',
                                replace_old=True)


#--- Generic usage ----------------------------------------------
file_key = generate_file_key('test_dir.%(weekday)s.tgz')
gz_filename = gunzip_dir('test_dir/', file_key)
s3_uploader.upload(file_key, gz_filename, replace_old=True)
os.remove(gz_filename)

Copyright: 2010 by amix License: BSD.

Release History

Release History

This version
History Node

1.3

History Node

1.2

History Node

1.1

History Node

1.0

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
avoid_disaster-1.3-py2.7.egg (6.1 kB) Copy SHA256 Checksum SHA256 2.7 Egg Sep 16, 2013
avoid_disaster-1.3.tar.gz (3.0 kB) Copy SHA256 Checksum SHA256 Source Sep 16, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting