rmtsrc / mysqlbackup

A bash script to store databases in separate files with daily, weekly and monthly rotation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MySQL database backup

A bash script to store databases in separate files with daily, weekly and monthly rotation.

Usage

./mysqlbackup.sh

Configuration (optional)

Copy mysqlbackup.sample.conf to: mysqlbackup.conf and customise as necessary.

Background

Normally using:

mysqldump --all-databases

Means that all databases are backed up into one massive single file; so it makes it a little bit tricky to pull out individual databases.

This is based on MySQL backup bash script will automatically separate out the databases into their own files making it a lot easier to manage.

The mysqldump command has been customised to be more reliable (handling UTF-8, stored procedures, not breaking foreign key indexes etc.) and the ability to handle multiple config files. It can also automatically rotate archive backups for x number of months, weeks and days.

About

A bash script to store databases in separate files with daily, weekly and monthly rotation


Languages

Language:Shell 100.0%