您好,登錄后才能下訂單哦!
改幾個變量就可以用了, innobackup的全備和打包腳本
[root@Pro-aliyun-MySQL-transit-10.25.34.225 ~]# cat full.sh?
#!/bin/bash
# centos 7.6 x86_64
# mysql 5.7.26-log
# 2019.9.16
# Version 2.4 begins to support 5.7
# https://www.percona.com/downloads/XtraBackup/
# wget -c https://www.percona.com/downloads/XtraBackup/Percona-XtraBackup-2.4.9/binary/redhat/6/x86_64/percona-xtrabackup-24-2.4.9-1.el6.x86_64.rpm --no-check-certificate
# yum -y localinstall percona-xtrabackup-24-2.4.9-1.el6.x86_64.rpm
a=`date +%s`
yum -y install perl perl-devel libaio libaio-devel perl-Time-HiRes perl-DBD-MySQL libev-devel
LOCALIP=$(hostname -i)
MYCNF=/owhat/mysql-5.7
HOST=localhost
USER=root
PASS=amunlinux
PORT=65306
SOCK=/owhat/mysql-5.7/logs/mysql.sock
DATA=/owhat/download-data
DATE=$(date +%Y-%m-%d)
touch ~/full-record-"$LOCALIP".log
> ~/full-record-"$LOCALIP".log
which innobackupex >> ~/full-record-"$LOCALIP".log
#/usr/bin/innobackupex? ?\
#--defaults-file="$MYFILEDIR"? \
#--user="$USER"? \
#--port="$PORT"? \
#--host="$HOST"? \
#--password="$PASS"? \
#--parallel=32? \
#-S "$SOCK"? \
#--no-timestamp "$DATA"/"$DATE" >>? ~/full-record-"$LOCALIP".log
sleep 3s
# <= 50G
tar -zcvP -f? ~/AliyunMySQL-$LOCALIP-$DATE.tar.gz "$DATA"/"$DATE" >> ~/full-record-"$LOCALIP".log
sleep 3s
b=`date +%s`
c=`expr $b - $a`
echo "A total of time $c s" >> ~/full-record-"$LOCALIP".log
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。