您好,登錄后才能下訂單哦!
1、xbstream 流,本地文件夾可以自己創建,異地文件夾必須存在
?innobackupex?--host=127.0.0.1??--post=3306?--stream=xbstream??--compress?/root/backup/?|?ssh?root@192.168.56.15?"xbstream?-x?-C?/tmp/"
2、xbstream 流,對端機器需要解壓并清理壓縮文件
192.168.56.15 xtrabackup?--decompress?--target-dir=/tmp/ find?/tmp/?-name?"*.qp"?|xargs??rm?-f
3、xbstream 流對端需要安裝軟件
3.1 xtrabackup
3.2 qpress-11-linux-x64.tar
4、腳本,周一全備,其它都是增備
[root@es1?chkpoint]#?cat?backup.sh #!/bin/bash LOCALDIR=/data/backup CHECKPIONTDIR=$LOCALDIR/chkpoint REMOTEDIR=/tmp/ WEEKDAY=`date?+%u` INTERVARNUM=`expr?$WEEKDAY?-?1` TISHWEEKFULL=`date?-d?"$INTERVARNUM?day?ago"?+%F` TODAY=`date?+%F` ssh?root@192.168.56.19?"mkdir?-p?/$REMOTEDIR/$TISHWEEKFULL" ssh?root@192.168.56.19?"mkdir?-p?/$REMOTEDIR/$TISHWEEKFULL/$TODAY" if?[?!?-f?$CHECKPIONTDIR/xtrabackup_checkpoints?]?;then echo?"沒有lsn信息,開始一次全備" innobackupex?--host=127.0.0.1?--history??--post=3306?--stream=xbstream???--compress?--extra-lsndir=$CHECKPIONTDIR??$LOCALDIR?|ssh?root@192.168.56.19?"xbstream?-x?-C?/$REMOTEDIR/$TISHWEEKFULL/" exit?1 fi case?$WEEKDAY?in #判斷變量WEEKDAY的值 ????"1") ????innobackupex?--host=127.0.0.1?--history??--post=3306?--stream=xbstream???--compress?--extra-lsndir=$CHECKPIONTDIR??$LOCALDIR?|ssh?root@192.168.56.19?"xbstream?-x?-C?/$REMOTEDIR/$TISHWEEKFULL/"????????;; ????"2") ???????innobackupex?--host=127.0.0.1??--post=3306?--stream=xbstream??--history?????--incremental?--extra-lsndir=$CHECKPIONTDIR??--incremental-basedir=$CHECKPIONTDIR???--compress?$LOCALDIR?|?ssh?root@192.168.56.19?"xbstream?-x?-C?/$REMOTEDIR/$TISHWEEKFULL/$TODAY" ????????;; ????????"3") ???????innobackupex?--host=127.0.0.1??--post=3306?--stream=xbstream??--history?????--incremental?--extra-lsndir=$CHECKPIONTDIR??--incremental-basedir=$CHECKPIONTDIR???--compress?$LOCALDIR?|?ssh?root@192.168.56.19?"xbstream?-x?-C?/$REMOTEDIR/$TISHWEEKFULL/$TODAY" ????????;; ????"4") ???????innobackupex?--host=127.0.0.1??--post=3306?--stream=xbstream??--history?????--incremental?--extra-lsndir=$CHECKPIONTDIR??--incremental-basedir=$CHECKPIONTDIR???--compress?$LOCALDIR?|?ssh?root@192.168.56.19?"xbstream?-x?-C?/$REMOTEDIR/$TISHWEEKFULL/$TODAY" ????????;; ????????"5") ???????innobackupex?--host=127.0.0.1??--post=3306?--stream=xbstream??--history?????--incremental?--extra-lsndir=$CHECKPIONTDIR??--incremental-basedir=$CHECKPIONTDIR???--compress?$LOCALDIR?|?ssh?root@192.168.56.19?"xbstream?-x?-C?/$REMOTEDIR/$TISHWEEKFULL/$TODAY" ????????;; ????????"3") ???????innobackupex?--host=127.0.0.1??--post=3306?--stream=xbstream??--history?????--incremental?--extra-lsndir=$CHECKPIONTDIR??--incremental-basedir=$CHECKPIONTDIR???--compress?$LOCALDIR?|?ssh?root@192.168.56.19?"xbstream?-x?-C?/$REMOTEDIR/$TISHWEEKFULL/$TODAY" ????????;; ????"4") ???????innobackupex?--host=127.0.0.1??--post=3306?--stream=xbstream??--history?????--incremental?--extra-lsndir=$CHECKPIONTDIR??--incremental-basedir=$CHECKPIONTDIR???--compress?$LOCALDIR?|?ssh?root@192.168.56.19?"xbstream?-x?-C?/$REMOTEDIR/$TISHWEEKFULL/$TODAY" ????????;; esac
5、tar 目前不支持增備,壓縮解壓需要注意,需要tar -xizvf? *.tar.gz
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。