Web System. The most important issue is the security and integrity of the database.
It is important to do a regular backup. Don't be lazy on this issue. Suppose your critical data is lost. will make you want to cry without tears.
export table structure and dataMysqldump-uroot-pmypassword--databases fansunion--result-file=/var/www/backup/fansunion-table-and-data.sql
Simply export table structureMysqldump-uroot-pmypassword--databases fansunion--no-data--result-file=/var/www/backup/fansunion-table.sql
Export Data onlyMysqldump-t-uroot-pmypassword--databases fansunion--result-file=/var/www/backup/fansunion-table-and-data.sql
Import DataSource/var/www/backup/fansunion-table.sql
Scheduled BackupsUse crontab scheduled backup mysqlcrontab-e 17 points per day. Run Backup Script 0 * * * */VAR/WWW/AUTOBACKUP-MYSQL.SH (online There is said to be able to place users.) Just tried the next, incorrect, ' 0 * * * root/var/www/autobackup-mysql.sh ')
autobackup-mysql.shnow= ' Date ' +%y%m%d%h%m%s "' file="/var/www/backup/fansunion-table-data-"$now". sql "/usr/local/mysql/bin/mysqldump- Uroot-pmypassword--databases fansunion-t > $file
Remember that the mysqldump must use the full path.
References: http://bbs.chinaunix.net/thread-512166-1-1.html
0 * * */root/backup/autobackup-mysql.sh
Original starting:http://fansunion.cn/article/detail/58.html
MySQL database timed its own active backup script