November 5, 2011

Simple MySQL online backup script

I've used this script to backup my MySQL database on my Virtual Server at Carrot. But at the end of this month Carrot closes his doors and I have decided to leave the Virtual Server path due my spare time. So here is the backup script, maybe someone can use it.

Introduction

The script creates an online backup from a running MySQL database and transfers it to a remote server. With a little bit bash know how the script can be adapted to save the backup on a local storage. After the backup the script sends an email to the specified email address on success or error.

Requirements

To get the script running Percona's XtraBackup must be installed on the server. For Gentoo there exist some portage ebuilds in the wild. For other linux distros look at the download page.

The backup files are created in the form /backupdir/weekday/hour.tar.gz. So a directory for every weekday must be created in the backup directory.

The source

No comments:

Post a Comment