Skip to main content

Fully automated backup & restore application, with E2E encryption. Stores backups on Backup Repository server or saves into file

Project description

Bahub - shell backup client

Backups made easy, automated, monitored.

# common flows
bahub :backup:make my_db
bahub :backup:restore my_db --version=v1
bahub :backup:restore my_db # latest

# inline docs
bahub :help:info               # Lists all built-in backup types and transports
bahub :help:transport:example  # Shows example transport configuration for given transport
bahub :help:backup:example     # Shows a example configuration for a given backup type
accesses:
    my_local_instance:
        url: "http://localhost:8000"
        token: "${API_TOKEN}"  # example of reading a variable from ENVIRONMENT

encryption:
    my_key_pair_one:
        gnupg_home: "~/.bahub-gnupg"
        passphrase: "capitalism-must-end"
        method: "aes256"
        username: "Mikhail Bakunin"
        email: "bakunin@example.org"

transports:
    my_docker_mysql_container:
        type: bahub.transports.docker  # Please notice: Transport name is a Python package path, unofficial transports are welcome!
        spec:
            container: "bahub_adapter_integrations_db_mysql_1"

backups:
    db_mysql:
        meta:
            type: bahub.adapters.mysql   # Please notice: This is a Python package path, unofficial adapters are welcome!
            access: my_local_instance    # Please notice: You can backup to multiple remote servers
            encryption: my_key_pair_one  # Please notice: You can encrypt with different keys as you wish
            collection_id: "11111-2222-33333-4444" # collection id created on Backup Repository server (optional when saving backup to file only)
            transport: my_docker_mysql_container  # Please notice: You can execute the backup EVERYWHERE
        spec:
            host: "my-database-host.local"
            port: 3306
            user: "root"
            password: "root"
            #database: "example" # when "database" is not specified, the all databases will be dumped

Features:

  • End-To-End encryption using GNU Privacy Guard, you can store your backups on a remote server that will not know what you store
  • Natively sends backups to Backup Repository server, or stores into files
  • Backups made with just a one simple command bahub :backup:make my-db
  • Restoring is as simple as backup bahub :backup:restore my-db
  • Does not require additional disk space to store backup, the backup is done on-the-fly
  • Natively supports Docker, including databases running in Docker
  • Understands what is to back up by using native methods such as mysqldump, pg_dump and others depending on what application is it
  • Supports "offline backup" of Docker containers by turning them off, then copying the data
  • Slack/Mattermost notifications about successes and failures
  • Errors monitoring with Sentry.io support

Abstract architecture:

  • Adapters like mysql, postgres_dump, filesystem are defining how to properly do your backup, there can be many more adapters, even made by external people all around the world
  • Transports: We support executing backup in sh (local shell), docker (docker container), temporarydocker (offline, copying files of other docker container), but feel free to write your own transport or use transport written by other people. There are many possibilities such as enabling SSH, Kubernetes, ECS and more.

Extensible:

  • Although we do not support currently Kubernetes or remote backups via SSH it does not mean that it is impossible - Bahub is extensible, everyone can write an adapter that will enable Kubernetes, ECS, SSH or any other transport that can run commands and return output
  • Bahub can use backup adapters and command transports that are placed in other Python packages, so any unofficial adapters and transports are easily pluggable!

Requirements

  • Linux machine when installed directly on host machine, any other os if running on Docker (including Windows)
  • Python 3.9 (if you cannot afford to install it on your old CentOS, then use Docker)
  • MySQL client tools (if going to backup & restore MySQL databases)
  • PostgreSQL client tools (if going to backup & restore PostgreSQL databases)
  • GNU tar
  • GNU Privacy Guard 2.x (mandatory, for E2E encryption support. There is no way to turn off encryption)

Installing

a) via Python package (on host machine)

pip install bahub

b) via Docker (in a container)

# todo

Development

export RKD_SYS_LOG_LEVEL=debug
python -m bahub -rl debug :SOME-TASK-HERE --config=./bahub.conf.yaml

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bahub-2.1.0.0rc5.dev704.tar.gz (55.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bahub-2.1.0.0rc5.dev704-py3-none-any.whl (41.5 kB view details)

Uploaded Python 3

File details

Details for the file bahub-2.1.0.0rc5.dev704.tar.gz.

File metadata

  • Download URL: bahub-2.1.0.0rc5.dev704.tar.gz
  • Upload date:
  • Size: 55.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

File hashes

Hashes for bahub-2.1.0.0rc5.dev704.tar.gz
Algorithm Hash digest
SHA256 736f9d77ebbbe1c8a558551a7f8036aba4207c64a1311747c242dc3509396ed5
MD5 a2c9bc2e75071cfdf91555cc70152f4a
BLAKE2b-256 6e0dd09ef7cbf9d1af199ac753a47ff978f752b8e13fe11d058dd00c397610d4

See more details on using hashes here.

File details

Details for the file bahub-2.1.0.0rc5.dev704-py3-none-any.whl.

File metadata

  • Download URL: bahub-2.1.0.0rc5.dev704-py3-none-any.whl
  • Upload date:
  • Size: 41.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

File hashes

Hashes for bahub-2.1.0.0rc5.dev704-py3-none-any.whl
Algorithm Hash digest
SHA256 5e03ff1800eb734e33da0a32f8f59fc5acee87bc3e16cbf911b668bf4dd64dcb
MD5 6db14645ad4c97672bfd447facc47012
BLAKE2b-256 edbf070dec1f2ec110afbf0b80d1fc1e0acf8bdc3351cc181ce9581b83b73cf2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page