xtrabackup 下载地址
xtrabackup 文档地址
获取软件:
wget https://www.percona.com/downloads/Percona-XtraBackup-LATEST/Percona-XtraBackup-8.0-8/binary/redhat/7/x86_64/percona-xtrabackup-80-8.0.8-1.el7.x86_64.rpm
安装软件:
rpm rpm -ivh percona-xtrabackup-80-8.0.4-1.el7.x86_64.rpm
如果没有报错信息请忽略
libev.so.4()(64bit) 被 percona-xtrabackup-80-8.0.4-1.el7.x86_64 需要
perl(DBD::mysql) 被 percona-xtrabackup-80-8.0.4-1.el7.x86_64 需要
perl(Digest::MD5) 被 percona-xtrabackup-80-8.0.4-1.el7.x86_64 需要
安装libev
yum install -y libev
安装perl(DBD::mysql)
yum install -y perl-DBD-MySQL
安装perl(Digest:MD5)
yum install -y perl-Digest-MD5
xtrabackup --user=**** --password=**** --backup --compress --compress-threads=4 --target-dir={自己制定dir}
#!/bin/sh
BASEDIR='/qhdata/mysql/backup/'
TODAY=`date +%Y-%m-%d`
USER='xxxx'
PASSWORD='xxx'
LAST_MONTH=`date '-d 35 day ago' '+%Y-%m-%d'`
/usr/bin/xtrabackup --user=${USER} --password=${PASSWORD} --databases=qhdata_map --backup --compress --compress-threads=4 --target-dir=${BASEDIR}${TODAY}
rm -rf ${BASEDIR}${LAST_MONTH}
* * * * 7 /qhdata/mysql/xtrabackup.sh