Linux7_MySQL5.7_主从复制_scripts
# cat my_full_backup.sh #!/bin/bash BEGINTIME=`date +"%Y-%m-%d %H:%M:%S"` format_time=`date +"%Y-%m-%d_%H:%M:%S"` week=`date +%w` port=3306 ip=192.168.1.101 backdir=/tmp/xtrabackup file_cnf=/app/mysqldata/3306/my.cnf user_name=xtrabk password=onlybackup out_log=$backdir/Xtrabackup_log_$format_time time_cost=$backdir/Xtrabackup_time.txt mysql_path=/usr/bin mkdir -p $backdir #full if [ ! -d "$backdir/full" ];then echo "#####start full backup at $BEGINTIME to directory full" >>$time_cost ${mysql_path}/innobackupex --defaults-file=$file_cnf --no-timestamp --parallel=4 --throttle=200 --kill-long