#!/bin/bash
dr=`date +%m%d`
day=`date +%Y%m%d`
d=`date +%Y%m%d%H%M`
if [[ ! -d /backup/$dr/$day ]];then
mkdir -p /backup/$dr/
innobackupex --defaults-file=/etc/my.cnf --no-timestamp --user=root --password=123 /backup/$dr/$day
fi
if [[ ! -s /backup/$dr/d.txt ]];then
#mkdir -p /backup/$dr/$d
echo $d >>/backup/$dr/d.txt
innobackupex --defaults-file=/etc/my.cnf --no-timestamp --user=root --password=123--incremental --incremental-basedir=/backup/$dr/$day /backup/$dr/$d
else
#mkdir -p /backup/$dr/$d
innobackupex --defaults-file=/etc/my.cnf --no-timestamp --user=root --password=123 --incremental --incremental-basedir=/backup/$dr/$day /backup/$dr/$d
echo $d >>/backup/$dr/d.txt
fi
xtrabackup备份
阅读(832) | 评论(0) | 转发(0) |