rem ******MySQL backup start********
@echo off
forfiles /p "D:备份发布软件备份" /m backup_*.sql -d -30 /c "cmd /c del /f @path"
set "Ymd=%date:~0,4%%date:~5,2%%date:~8,2%0%time:~1,1%%time:~3,2%%time:~6,2%"
"C:Program Files (x86)WinRARRar.exe" a -r -s -m1 "D:备份发布软件备份website_%Ymd%.rar" "D:website"
@echo on
rem ******MySQL backup end********
1、备份在哪个文件夹下
2、winrar的Rar.exe文件路径
3、备份的文件名规则,ymd是动态日期
4、被备份的文件夹