#!bin/bash #备份数据库 #数据库信息 db_user="root" db_password="ssssss" db_name="yxxxxx" #备份信息 backup_path="/webserver/www/cms.ss.com/" filename=$db_name`date +%Y-%m-%d ` mysqldump -u $db_user -p$db_password $db_name | gzip > $backup_path$filename.sql.gz find /webserver/www/cms.tk.com/ -mtime +7 -name "*.sql.gz" -exec rm -rf {} /;
删除文件
http://www.cnblogs.com/peida/archive/2013/03/25/2980121.html
执行shell
/we/test.sh
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/2016.html