bat文件内容如下:
@echo off
Set nowdate=%date:~,10%Md d:\ddwj\sjkbf\"%nowdate:/=%"
E:\wamp\bin\mysql\mysql5.5.24\bin\mysqldump.exe -h IP -P port -u user -ppassword database> d:/ddwj/sjkbf/%nowdate:/=%/filename.sql
forfiles /p d:\ddwj\sjkbf\ /d -5 /c "cmd /c if @ISDIR==TRUE rd /s/q @path"
加入计划任务即可。