Creare MySQL Backup cu AutoMySQLBackup

1. instalam AutoMySQLBackup

Debian

[root@LinuxPedia ~]# apt-get install automysqlbackup

CentOS

[root@LinuxPedia ~]# yum install automysqlbackup
[root@LinuxPedia ~]# nano /etc/default/automysqlbackup

In fisierul automysqlbackup vom configura urmatoarele lini:

[...]
# 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@linuxpedia.ro"
[...]

2. Pornim automysqlbackup

[root@LinuxPedia ~]# automysqlbackup
[root@linuxpedia ~]# ls -l /var/lib/automysqlbackup

In directorul /var/lib/automysqlbackup vom avea urmatoarele date:

[root@LinuxPedia ~]# 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@LinuxPedia ~]#

Cam asta e !

Aveti nevoie de ajutor cu Linux Server sau WordPress?

Leave a Reply