#mkdir -p /home/db_backup
#cd /home/db_backup
#vim mysql_backup.sh
DATE=$(date +%Y%m%d_%H%M%S)
/alidata/server/mysql/bin/mysqldump --opt -uroot -ppassword dbname | gzip>/home/db_backup/data/$DATE.sql.gz

  

#crontab -e
*/30 * * * * /home/db_backup/mysql_backup.sh

半小时备份一次mysql

05-26 05:08