Commit e03e6c43 by tingweiwang

修改全备的删除时间为1天

1 parent 8567a2c0
Showing with 1 additions and 1 deletions
...@@ -31,7 +31,7 @@ echo "创建mysql全库备份所需目录" ...@@ -31,7 +31,7 @@ echo "创建mysql全库备份所需目录"
test -d $BACK_PATH/$DATE-all || mkdir $BACK_PATH/$DATE-all -pv test -d $BACK_PATH/$DATE-all || mkdir $BACK_PATH/$DATE-all -pv
mysqldump -u${USER} -p${PASSWD} -h $HOST --routines --single-transaction --master-data=2 -A -B -F |gzip >$BACK_PATH/$DATE-all/all.sql.gz mysqldump -u${USER} -p${PASSWD} -h $HOST --routines --single-transaction --master-data=2 -A -B -F |gzip >$BACK_PATH/$DATE-all/all.sql.gz
find $BACK_PATH/ -mmin +1 -type d |xargs rm -rf find $BACK_PATH/ -mtime +1 -type d |xargs rm -rf
} }
#搭配计划任务,执行频率为1天1次,只保留一天的备份。 #搭配计划任务,执行频率为1天1次,只保留一天的备份。
################################################################################################### ###################################################################################################
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!