Coder Social home page Coder Social logo

mysql-xtrabackup's Introduction

mysql-xtrabackup

A wrapper round Percona's Xtrabackup script:

https://www.percona.com/software/mysql-database/percona-xtrabackup

this is meant to be cronned and used to produce a series of copies of the db to be kept as backups.

Stick something like this in your crontab:

0 2 1 * * *  mysql-xtrabackup --defaults-file ~/backups.my.cnf --label monthly --max-days 95

and keep about three month's worth of monthly archives of your DB, stored named something like this:

/home/mysql-xtrabackup/monthly/2018-01-01_02.00.01_fri-mysql-xtrabackup.tar.gz
/home/mysql-xtrabackup/monthly/2018-02-01_02.00.01_fri-mysql-xtrabackup.tar.gz
/home/mysql-xtrabackup/monthly/2018-03-01_02.00.01_fri-mysql-xtrabackup.tar.gz
/home/mysql-xtrabackup/monthly/2018-04-01_02.00.01_fri-mysql-xtrabackup.tar.gz

And each of these is just a gzipped tarball of the /var/lib/mysql directory that innobackupex produced. See the --help output (or ./help.txt) for an explanation of what the labels mean.

Logfiles are written so as to be self-rotating; the above backups will have produced these logfiles:

/var/log/mysql-xtrabackup/jan-monthly
/var/log/mysql-xtrabackup/feb-monthly
/var/log/mysql-xtrabackup/mar-monthly
/var/log/mysql-xtrabackup/apr-monthly

so you'll only ever have 12 of them, and can always inspect the last file to get the status of the last backup (see my check_log project for how I do that in icinga).

mysql-xtrabackup's People

Contributors

bigreds avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

thaspius

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.