【mysql】mysql 备份脚本
#! /bin/bash
HOST=localhost
USER=root
PASSWORD=password
DATE_STR=$(date '+%F--%T')
ERROR_LOG=/usr/local/src/mysql-backup/jxsb/mysql_back_error_${DATE_STR}.log
BACK_LOG=/usr/local/src/mysql-backup/jxsb/full_back_up_${DATE_STR}.sql
/usr/local/mysql/bin/mysqldump --host=$HOST --user=$USER \
-C -Q --password=$PASSWORD --master-data=2 --databases jxsb \
--single-transaction --events --force \
--flush-logs --log-error=$ERROR_LOG --routines --triggers \
--result-file=$BACK_LOG
echo '执行完毕'