Hi
Hướng dẫn thiết lập để tự động backup cơ sở dữ liệu trên MySQL
1. Vào trang
http://sourceforge.net/project/showfile ... _id=101066Để download file scipts
automysqlbackup.sh.2.5
2. Bạn đặt vào 1 thư mục nào đó
/install/automysqlbackup.sh.2.5
sao chép thành tệp .sh
cp automysqlbackup.sh.2.5 automysqlbackup.sh
3. Bạn vào trong và chỉnh sửa chút
# Username to access the MySQL server e.g. dbuser
USERNAME=root
# Username to access the MySQL server e.g. password
PASSWORD=123456
# 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"
DBNAMES="moodle sugarcrm"
# Backup directory location e.g /backups
BACKUPDIR="/home/backups"
4. Trao quyền chạy cho nó
chmod 777 automysqlbackup.sh
5. Chạy backup
./automysqlbackup.sh
6. Đặt tự động vào trong crontab
vim /etc/crontab
30 3 * * * root /install/automysqlbackup.sh
7. Khởi động lại crond
service crond restart
Như thế là máy sẽ tự động backup dữ liệu của các cơ sở dữ liệu "moodle
sugarcrm"
vào trong /home/backups
--
Nguyen Van Thanh