Skip to main content

Database backup utility

Project description

backups

Build Status

Basic tool to backup mysql databases.

Installation

pip install --upgrade backups

Usage

$ backups run local --help
Backups mysql databases and server

Usage:
  backups ls                    [--file FILE] [--verbose]
  backups show NAME             [--file FILE] [--verbose]
  backups databases NAME        [--file FILE] [--verbose]
  backups run NAME              [--file FILE] [--verbose] [--dryrun]
  backups run NAME [DATABASE]   [--file FILE] [--verbose] [--dryrun]

Commands:
  ls          Prints the backups names
  show        Prints the configuration for a named backup
  databases   Lists all databases on a name backup server
  run         Runs the backup for a config

Options:
  -f --file FILE    The backups config file [default: /etc/backups/backups.yaml]
  -d --dryrun       Just prints the commands but doesn't execute them
  -v --verbose      Adds verbosity
  -h --help         Prints this help
     --version      Prints the current version

Environment variables:
  BACKUPS_FILE          Use this file instead of /etc/backups/backups.yaml
  BACKUPS_DUMPS_DIR     Use this directory instead of /tmp/backups
  BACKUPS_MYSQLDUMP     Use this binary instead of mysqldump from the $PATH


Check https://github.com/ptdorf/backups#backups for more info

Setup

Create a /etc/backups/backups.yaml file with content similar to:

backups:
  acme:
    connection:
      type:         mysql
      host:         acme.com
      username:     backups
      password:     password
    upload:
      s3:
        bucket: acme-backups
        path:   databases
    options:
      # By default it will create a single dump file for each database found
      # Uncomment the options below to change this
      # database:     main_db   # Uncomment to dump this single database
      # server:       true      # Uncomment to dump the server into a single file
      encryption
        pasword:    secret

Now run it with

backup-mysql run acme

Or if you placed the backup file in some other place:

backup-mysql run acme --file examples/mysql.yaml

Project details


Download files

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

Files for backups, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size backups-0.2.0-py2.py3-none-any.whl (11.1 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size backups-0.2.0.tar.gz (8.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page