Skip to main content

Implements a simple backup script to backup things to Amazon S3

Project description

avoid_disaster

Implements a simple backup script to backup things to Amazon S3. avoid_disaster be used to easily script daily, weekly or monthly backups.

For more information check out: http://amix.dk/blog/post/19529#avoid-disaster-Easily-script-daily-or-weekly-backups-to-S3

Examples

Backup test_dir to S3:

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')

#--- Backup directory ----------------------------------------------
file_key = generate_file_key('test_dir.%(weekday)s.tar.gz')

gz_filename = gunzip_dir('test_dir/', file_key)

s3_uploader.upload(file_key, gz_filename, delete_old=True)

os.remove(gz_filename)

Copyright: 2010 by amix License: BSD.

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

avoid_disaster-1.0.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

avoid_disaster-1.0-py2.6.egg (5.6 kB view details)

Uploaded Source

File details

Details for the file avoid_disaster-1.0.tar.gz.

File metadata

File hashes

Hashes for avoid_disaster-1.0.tar.gz
Algorithm Hash digest
SHA256 bdb2a8f6cac738e4132a843900744ffc3085f6ec562b71151698f53cb475d282
MD5 828e34fe43877dbc48c9c78919603891
BLAKE2b-256 3ad0241b985d35665c20e897387d3cb9939d163f1aa6cf8f4c008ccdd85a98f8

See more details on using hashes here.

Provenance

File details

Details for the file avoid_disaster-1.0-py2.6.egg.

File metadata

File hashes

Hashes for avoid_disaster-1.0-py2.6.egg
Algorithm Hash digest
SHA256 c037a6e151908b435db87b9d5a8ded24df77e87fefab7f49a94810275b264df3
MD5 9b2f6027ebbb5f7c1d0008f65a4031cf
BLAKE2b-256 4d2c1e6f072f17459f276d3cbf1a6e4b5fc0caaa3019bf5dbc28651c78f52050

See more details on using hashes here.

Provenance

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