MySQL backup scripts ==================== By BOfH | Bob's Basement www.bobsbasement.co.uk These four scripts prepare your MySQL data to be backed up and then clean up after themselves. mysql-backup-config.pl: This is the config file. To be stored in /etc/ by default. If you want to store it in a different place, you need to change the path in each of the scripts. The script needs to contain the MySQL server to connect to and a user and password for a user that has permission to lock the database. It also needs a name of one of the databases. This is used only to connect to the database and has no other use. Finally, you need to add the path to your MySQL databases, the path to your transaction logs and a staging directory. mysql-db-prebackup.pl: This file should be run before performing a cold/full backup mysql-db-postbackup.pl: This file should be run after performing a cold/full backup mysql-tlogs-prebackup.pl: This file should be run before performing a backup of the transaction logs mysql-tlogs-postbackup.pl: This file should be run after performing a backup of the transaction logs Most backup software allows you to configure a script to be executed before and after a job is run. These scripts copy the data to be backed up to a staging directory and then delete it afterwards, so you need to create a job to run the scripts and then backup the staging area.