0.0
No commit activity in last 3 years
No release in over 3 years
A simple backup tool for MySQL that takes a backup of all MySQL databases.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

mysql-backup

A command line tool that backups all MySQL database instances it can find on a MySQL server.

Installation


  $ sudo gem install mysql_backup —source http://gemcutter.org

You can also grab the source code and install with rake:


$ cd /usr/local/src $ git clone git://github.com/christianhellsten/mysql-backup.git $ cd mysql-backup $ sudo rake install

Configuration

Configuration is easy, just run the built-in mysql_backup_install command:


  $ sudo mysql_backup_install

The installation script will ask you to enter all necessary information and then writes the configuration to /etc/mysql_backup.

Usage

Taking a backup of all databases is also easy:


  $ sudo mysql_backup

This will backup all databases, except the ones defined in the configuration file using the skip parameter.

Scheduled backups with cron

Open the cron configuration with the following command:


$ sudo crontab -e

Add the following:


PATH=/usr/local/bin:/usr/bin:/bin
SHELL=/bin/bash

# m h  dom mon dow   command

# Backup all MySQL databases every night at 24:00

00 00 * * * mysql_backup

Sample configuration


user: root
password: xxx
host: localhost
dir: /var/backup
format: %d-%m-%y
keep: 10

mysqldump:
  options: -Q -c -C --add-drop-table --add-locks --quick --lock-tables
  path:
skip: [mysql, test, information_schema]

TODO

  • Refactor
  • List dependencies
  • Handle command line errors gracefully
  • Nice

Author

Christian Hellsten (Aktagon Ltd.)