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.
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.3.tar.gz
(3.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
avoid_disaster-1.3-py2.7.egg
(6.1 kB
view details)
File details
Details for the file avoid_disaster-1.3.tar.gz.
File metadata
- Download URL: avoid_disaster-1.3.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
619a6e6db716614889d78f8b79d53fff1f8e2c41e7ed3a1c822cbe75b108bed9
|
|
| MD5 |
b747de47e5264d55f2106967e7ce8abd
|
|
| BLAKE2b-256 |
4457f480db418ab851214e8dd86b1dda8f3f4678a1491e04efea7a8f0b670416
|
File details
Details for the file avoid_disaster-1.3-py2.7.egg.
File metadata
- Download URL: avoid_disaster-1.3-py2.7.egg
- Upload date:
- Size: 6.1 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10c648c002524ab546c31d1b75d35f5b3458347c56040666db841d32a7528513
|
|
| MD5 |
b88621b88af41634b137057c493c40e4
|
|
| BLAKE2b-256 |
93ff83172584631daccb37dd57b3fa9f663d31cdca31e662934d727876ac989d
|