Skip to main content

Filesystem and database backup Buildout recipe.

Project description

praekelt.recipe.backup

Filesystem and database backup Buildout recipe.

Creates a bin/ script with which you can easily create backups of any path and/or database.

Usage

Add a part in buildout.cfg like so:

[buildout]
parts = backup

[backup]
recipe = praekelt.recipe.backup
archive_prefix = backmeup
local_location = /var/backup

Running the buildout will add a backup script with the same name as your backup part in the bin/ directory. In this case bin/backup.

Note: The basic script created by the part specified above will create empty backups. To actually backup usefull data you need to enable path and/or database backups. See options below.

Options

archive_prefix

String prefixed to backup archive filenames. Required

database_enabled

Whether or not to include a database backup. Defaults to False

database_engine

Type of database to backup. Supported options mysql or postgres

database_name

Name of the database to backup.

database_username

Username of the database to backup.

database_password

Password of the database to backup.

path_enabled = True

Whether or not to recursively include a path in the backup. Defaults to False

path

Path to backup. Defaults to the buildout directory

local_count

Number of backups to keep locally. As new backups are created older backups are deleted. Defaults to 3

local_location

Local path in which to store backups. Also used as a sandbox when creating backups. Make sure the user running the backup script has appropriate rights to this path. Required

scp_enabled

Whether or not to send a copy of created backups to a remote location via scp. Default to False

Note: scp functionality is limited to key based authentication. Make sure to setup your keys appropriately for passwordless authentication.

scp_username

Remote scp login username.

scp_host

Remote scp hostname.

scp_path

Remote path in which to store backups.

Full Example

The following example illustrates all available options:

[buildout]
parts = backup

[backup]
recipe = praekelt.recipe.backup
archive_prefix = shop

database_enabled = True
database_engine = postgres
database_name = shop
database_username = admin
database_password = pass1word

path_enabled = True
path = /var/www

local_count = 2
local_location = /var/backups

scp_enabled = True
scp_username = admin
scp_host = 10.23.12.1
scp_path = /var/backups/shop

The resulting script will create backup archives prefixed with the string shop in /var/backups. The archive will contain all the files in /var/www as well as a database dump of the postgres database named shop. A copy of each created archive will be sent to 10.23.12.1 via scp and stored in the /var/backups/shop path. Only the latest 2 backups will be retained locally. Older backups will be deleted automatically.

Changelog

0.0.2

  1. Dereference symbolic links.

0.0.1

  1. Initial Release

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

praekelt.recipe.backup-0.0.2.tar.gz (5.6 kB view details)

Uploaded Source

Built Distributions

praekelt.recipe.backup-0.0.2-py2.6.egg (9.0 kB view details)

Uploaded Source

praekelt.recipe.backup-0.0.2-py2.5.egg (9.0 kB view details)

Uploaded Source

File details

Details for the file praekelt.recipe.backup-0.0.2.tar.gz.

File metadata

File hashes

Hashes for praekelt.recipe.backup-0.0.2.tar.gz
Algorithm Hash digest
SHA256 55c2e155e9b090b44237df9f0d7231548c66fc265f197811fb38abdd224c66f3
MD5 9f4c959dd7bcdd8a266dd0d6669f9539
BLAKE2b-256 87888ba6d19b7a8d42669a9b28f3933eebcb2024da36bdca5819c4b5497886d4

See more details on using hashes here.

File details

Details for the file praekelt.recipe.backup-0.0.2-py2.6.egg.

File metadata

File hashes

Hashes for praekelt.recipe.backup-0.0.2-py2.6.egg
Algorithm Hash digest
SHA256 8d23d6a1696ab92c04966b3d778c883d999f984582c71e19d61c61d129372606
MD5 3886d83d42bfa68af0e333b5379a85d8
BLAKE2b-256 0e63e007b7dca556b667e7501398afc7be5f173676e6260d3fd5d66a7ece19c5

See more details on using hashes here.

File details

Details for the file praekelt.recipe.backup-0.0.2-py2.5.egg.

File metadata

File hashes

Hashes for praekelt.recipe.backup-0.0.2-py2.5.egg
Algorithm Hash digest
SHA256 0ed89255532af637e9cda38a00d5e2be7441d7d9c740302fb4068614065854fd
MD5 234619ad790e8545af478497cb2548c2
BLAKE2b-256 ca0ff7237032c729b737eb89799732a1962683d123f541eecba6daccef5ca1c0

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