Meniu

Creare MySQL Backup cu AutoMySQLBackup

MySQL Backup cu AutoMySQLBackup.

1. Instalam AutoMySQLBackup

Debian

apt-get install automysqlbackup

CentOS

yum install automysqlbackup

2.Deschidem fisierul /etc/default/automysqlbackup cu nano, vi, pico:

nano /etc/default/automysqlbackup

[…]
# Host name (or IP address) of MySQL server e.g localhost
DBHOST=localhost
[…]
# List of DBNAMES for Daily/Weekly Backup e.g. “DB1 DB2 DB3″
# The following is a quick hack that will find the names of the databases by
# reading the mysql folder content. Feel free to replace by something else.
#DBNAMES=”db_ispconfig web1 web2 web3″
DBNAMES=`find /var/lib/mysql -mindepth 1 -maxdepth 1 -type d | cut -d’/’ -f5 | grep -v ^mysql\$ | tr \\\r\\\n ,\ `
[…]
# Backup directory location e.g /backups
# Folders inside this one will be created (daily, weekly, etc.), and the
# subfolders will be database names.
BACKUPDIR=”/var/lib/automysqlbackup”
[…]
# Email Address to send mail to? (user@domain.com)
MAILADDR=”backup@domain.com”
[…]

3. Pornim automysqlbackup

root@gnulinux ~]# automysqlbackup
root@gnulinux ~]# ls -l /var/lib/automysqlbackup

Directorul /var/lib/automysqlbackup:

[root@gnulinux ~]# ls -l /var/lib/automysqlbackup
total 12
drwxr-xr-x 4 root root 4096 2010-01-27 17:20 daily
drwxr-xr-x 2 root root 4096 2010-01-27 17:20 monthly
drwxr-xr-x 4 root root 4096 2010-01-27 17:20 weekly
[root@gnulinux ~]#

Asta este !

Andreea

"Rome wasn't built in a day" !
  • | 120 articole

Nici un comentariu inca. Fii primul!
  • powered by Verysign