您好,登录后才能下订单哦!
改几个变量就可以用了, 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进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。