Home > Database > Mysql Tutorial > body text

mysql 备份需求_MySQL

WBOY
Release: 2016-06-01 13:11:14
Original
1079 people have browsed it

1、采用定时器来来控制php脚本备份。不涉及时间间隔。


2、脚本需要做的。

a、调用系统压缩命令,生成根据日期时间的压缩包。

b、只保留最近7天内的数据。



用的的方法如下:

rq=`date +%Y%m%d`zip -q -r  $rq.zip /opt/mysql/test
Copy after login


最近七天的时间 算法 暂时没有好的思路

 find 备份数据 -name "文件" -type f -mtime +7 -exec rm{};
Copy after login


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!