1. instalam AutoMySQLBackup
Debian
apt-get install automysqlbackup
CentOS
yum install automysqlbackup
Deschidem fisierul /etc/default/automysqlbackup cu nano, vi, pico eu o sa folosesc nano
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@linuxpedia.ro”
[...]
2. Pornim automysqlbackup
[root@linuxpedia ~]# automysqlbackup
[root@linuxpedia ~]# ls -l /var/lib/automysqlbackup
In directorul /var/lib/automysqlbackup ne arata 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 !