标签:定时备份mysql数据库
#!/bin/bash #SQL文件将要存放的路径 basepath_sql=‘/home/work/local/cms_sql_bak‘ #/home/work/local/cms_sql_bak savepath_sql=$basepath_sql/$(date +%Y)/$(date +%m) #创建目录 mkdir -pv $savepath_sql/ mysql_bin=‘/home/work/.jumbo/bin‘ $mysql_bin/mysqldump -uroot -padmin -h10.48.31.126 -P8006 --extended-insert=TRUE --database Vs_Finance_cms > $savepath_sql/Vs_Finance_cms_$(date +%Y)-$(date +%m)-$(date +%d)-$(date +%H).sql
配置定时:
* */1 * * * /home/work/local/cms_sql_bak/saveSQL.sh >> /home/work/local/cms_sql_bak/saveSQL.log 2>&1
本文出自 “梦朝思夕” 博客,请务必保留此出处http://qiangmzsx.blog.51cto.com/2052549/1576551
标签:定时备份mysql数据库
原文地址:http://qiangmzsx.blog.51cto.com/2052549/1576551