Giter VIP home page Giter VIP logo

autoxtrabackup's Introduction

autoxtrabackup

Automatic MySQL scheduled backups using Percona innobackupex (xtrabackup).
This script uses the innobackupex wrapper for xtrabackup from Percona, included in percona-xtrabackup.

Create full & incremental backups automatically, with configurable retention and compression, and optional e-mail output.

Requirements

Supported MySQL distributions: MySQL, Percona Server, MariaDB
Supported Linux distributions: Debian, Ubuntu, CentOS, RedHat
Dependencies: percona-xtrabackup, download from http://www.percona.com/software/percona-xtrabackup

This script has been tested on Debian 7 (Wheezy) with Percona-server 5.6.
This script has been tested on CentOS 6.4 with MariaDB-server-10.

Installation

Copy autoxtrabackup.config to /etc/backup/autoxtrabackup_$HOST and edit the settings This is not mandatory, but recommended. You can also set the settings in the script directly.
Copy autoxtrabackup.sh to /usr/local/bin/autoxtrabackup
Make it executable, and set a cronjob

For the config you use the named $HOST by runnion autoxtrabackup foo which maps to the config for /etc/backup/autoxtrabackup_foo

In this way you can create multiple backups

The script does not provide standard output. Check /tmp/backuplog

Examples

Create incremental backups each hour, and a full backup each 24 hours. Retention set to 1 week.

  • Set "hoursBeforeFull" to 24
  • Set "keepDays" to 7
  • Add a cronjob "0 * * * * /usr/local/bin/autoxtrabackup"

Create a full backup on Sunday, take incremental backups all other days. Keep backups for 1 month.

  • Set "hoursBeforeFull" to 168
  • Set "keepDays" to 31
  • Create the first backup on Sunday at the desired time, let's take 23h for example
  • Add a cronjob "0 23 * * * /usr/local/bin/autoxtrabackup"

Don't create incremental backups. Create a full backup every day at 23h, retention set to 1 week.

  • Set "hoursBeforeFull" to 1
  • Set "keepDays" to 7
  • Add a cronjob "0 23 * * * /usr/local/bin/autoxtrabackup"

Remarks

Incremental backups only apply to XtraDB & InnoDB tables.
Incremental backups of MyISAM tables are not possible, a full backup of such tables will be created each time.

Restoring

Use "./autoxtrabackup -h" for a quick reference on how to restore backups.

For more detailed information on how to restore a backup with innobackupex, visit http://www.percona.com/doc/percona-xtrabackup/2.2/innobackupex/innobackupex_script.html

autoxtrabackup's People

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.