Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Simple backup tool written in python3, which helps not to repeat scripts.
Python
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bytehold
config-examples
tests
.gitignore
LICENSE
MANIFEST
README.rst
bh
setup.py
test.py

README.rst

Bytehold

Simple backup tool written in python3, which helps not to repeat scripts.

Is based on handlers, and is very simple to extend. Creating a new handler and use it. The syntax is simplar to scons (declarative classes).

The simplest and most direct is to use a python module. But if you like. Ini files backups can define a very simple way. In general, the script only needs to know that data store and how to access that data.

Implemented handlers

  • FileSystem (use rsync for sincronize)
  • PostgreSQL (use pg_dump for database dump, xz for compression and scp for transport)
  • MySQL (mysqldump and mysqlhotcopy)
  • Tarball (Simple compressed tarball)

Compression format handling supported

  • Gzip
  • Bzip2
  • XZ (default)

Sample python declarative configuration:

from bytehold import Environment
from bytehold.handlers import FileSystem

Environment(name="mormont", remote_host="niwi@localhost", remote_path="/tmp/")
FileSystem(name="My Temporal directory", paths=['/home/niwi/tmp'])

Environment

Environment is a mandatory class, this stores all global variables need by handlers.

Arguments reference

name

Is a name that represents a backup, if not specified, hostname is used.

remote_host

Is a complete host and username string that representing the backup server.

remote_path

Is a base path on remote backup server on stores all backups. On this directory now need create other subdirectory that matches with envoronment name.

The backup files genetated by this script, are stored on {remote_path}/{environ:name}/

Usage examples:

And, this is a example:

[niwi@vaio.niwi.be][~/devel/bytehold]% ./bh -p backup.py.example -v
FileSystem - starting filesystem backup handler (My Temporal directory).
FileSystem - exec: rsync -avr /home/niwi/tmp niwi@localhost:/tmp/mormont

How to install

Yo can pull the git repo and execute python setup.py install.

TODO

  • Sphinx documentation.
  • Automaticaly create remote directory on demand. (Fix first execution fail if remote directory not exists)
  • Version check handler.
Something went wrong with that request. Please try again.