Skip to main content

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 files for avoid_disaster 1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for avoid_disaster 1.3
File Size Uploaded
avoid_disaster-1.3.tar.gz 3.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for avoid_disaster 1.3
File Interpreter ABI Platform
avoid_disaster-1.3-py2.7.egg Legacy Egg format - - Details

Total release size: 9.1 kB

Release files / avoid_disaster-1.3.tar.gz

Download URL avoid_disaster-1.3.tar.gz
Size 3.0 kB
Tags Source
SHA-256 checksum
How to use checksums
619a6e6db716614889d78f8b79d53fff1f8e2c41e7ed3a1c822cbe75b108bed9
BLAKE2b-256 checksum
How to use checksums
4457f480db418ab851214e8dd86b1dda8f3f4678a1491e04efea7a8f0b670416
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / avoid_disaster-1.3-py2.7.egg

Download URL avoid_disaster-1.3-py2.7.egg
Size 6.1 kB
Tags Egg
SHA-256 checksum
How to use checksums
10c648c002524ab546c31d1b75d35f5b3458347c56040666db841d32a7528513
BLAKE2b-256 checksum
How to use checksums
93ff83172584631daccb37dd57b3fa9f663d31cdca31e662934d727876ac989d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.3 This release

2 release files

1.2

2 release files

1.1

2 release files

1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page