数据库备份脚本
#!/bin/bash
day2=`date "+%Y-%m-%d" -d "-2 day"`
rm -rf /dfs1/bak/full/$day2*
echo $day2
innobackupex --defaults-file=/etc/my.cnf --user=root --password=******* /dfs1/bak/full/
#!/bin/bash
day=`date +%Y-%m-%d`
cd /dfs1/bak/full
day1=`ls |grep $day`
echo $day1
day2=`date "+%Y-%m-%d" -d "-2 day"`
rm -rf /dfs1/bak/backadd/$day2*
echo $day2
innobackupex --defaults-file=/etc/my.cnf --user=root --password=****** --incremental /dfs1/bak/backadd/ --incremental-basedir=/dfs1/bak/full/$day1