增量式备份

This commit is contained in:
zhangkun9038@dingtalk.com 2023-07-14 17:55:56 +08:00
parent 9ff003b250
commit bf449e6d98

View File

@ -22,8 +22,8 @@ fi
echo ""
# 获取当前binlog文件名和位置
CURRENT_BINLOG=$(mysql -u$userName -p$password -h$host -e "SHOW MASTER STATUS" | grep File | awk '{print $2}')
CURRENT_POSITION=$(mysql -u$userName -p$password -h$host -e "SHOW MASTER STATUS" | grep Position | awk '{print $2}')
CURRENT_BINLOG=$(mysql -u$userName -p$password -h$host -e "SHOW MASTER STATUS\G" | grep File | awk '{print $2}')
CURRENT_POSITION=$(mysql -u$userName -p$password -h$host -e "SHOW MASTER STATUS\G" | grep Position | awk '{print $2}')
# 备份增量变更到文件
# 如果上次备份的binlog文件名和位置为空则进行全量备份