* */3 * * * /home/databaseshell/DatabaseName.sh
DatabaseName.sh 内容
#!/bin/bash
filename="/home/backup/dianpu_$(date +%Y-%m-%d_%H-%M-%S).sql.gz"
mysqldump -uroot -pzjp800515. dianpu | gzip > $filename
#find /home/backup -type f -amin +3 -exec rm -f {} \;
find /home/backup -type f -mtime +7 -exec rm -f {} \;
/sbin/service crond start //启动服务
/sbin/service crond stop //关闭服务
/sbin/service crond restart //重启服务
/sbin/service crond reload //重新载入配置