innobackup的全备和打包脚本
改几个变量就可以用了, 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
新闻标题:innobackup的全备和打包脚本
网页网址:http://ybzwz.com/article/pgsddo.html