MySQL Backup for lazy sysadmins Installation




Step 1

[root@local~]# wget http://linux.alanstudio.hk/mysqlblasy-0.8.tgz
[root@local~]# tar -xvf mysqlblasy-0.8.tgz
[root@local~]# cd mysqlblasy-0.8
[root@local~]# mv mysqlblasy.pl /root/mysqlblasy.pl

Download the file and extract it.
Move the perl file "mysqlblasy.pl" and drop the path you want!

Official site:
http://freshmeat.net/projects/mysqlblasy/


Step 2

[root@local~]# vi /etc/mysqlblasy.conf

dbusername = root
dbpassword = password
dbhost = localhost
backupdir = /backup/mysql
exclude databases = lost+found
loglevel = 2
use compression = yes
use syslog = yes
keep = 30
optimize_tables = yes

Configure the configuration file.
   backupdir           = directory for placing the backup
   databases           = comma separated list of db's to backup (default all)
   exclude databases   = comma separated list of db's to NOT backup
   defaults-extra-file = path to an alternative my.cnf config file
   dbusername          = mysql username (it is recommended  to use defaults-extra-file)
   dbpassword          = password for user (it is recommended  to use defaults-extra-file)
   dbhost              = hostname of database server, this is used for the backup filename too.
                         If you use a defaults-extra-file, this can be used to set the filename
                         of the backup-file!
   optimize_tables     = yes or no or 1 or 0 (default no)
   loglevel            = NOP(0) ERR(1) WARNING(2) NOTICE(3) INFO(4) DEBUG(5), default 2
   mysql               = absolute path to the mysql binary (default from $PATH)
   mysqldump           = absolute path to the mysqldump binary (default from $PATH)
   use compression     = yes or no or 1 or 0 (default no)
   compression tool    = see below
   keep                = number of backup files to keep in backupdir
   use syslog          = yes or no or 1 or 0 (default yes)
   tar                 = see below

[root@local~]# crontab -e

## mysql backup every mid-night 0 0 * * * /root/mysqlblasy.pl &> /dev/null

Make the contab schedule to start backup



Server is hosted by Alanstudio
Linux Operating System

Recommend screen resolution 1024 x 768 / IE / FireFox
Alan Studio © 2007 by Alan Cheung Hin Lun. All rights reserved.