windows下備份mysql和網站的腳本
最近使用的一個windows下的數據庫和網站備份腳本:
www.2cto.com
set today=%date:~0,4%-%date:~5,2%-%date:~8,2%
for /f %%i in ('dir d:\wamp\bin\mysql\mysql5.5.20\data /ad /b ') do d:\wamp\bin\mysql\mysql5.5.20\bin\mysqldump.exe -u root -proot %%i >d:\wamp\sql\%%i.sql
net stop wampapache
net stop wampmysqld
7z.exe a -tzip d:\wamp.backup\%today%-wamp.zip d:\wamp\ -mx0 -xr!u_mtc -xr!6027 >d:\wamp.backup\%today%-wamp.log
net start wampmysqld
net start wampapache
del /q d:\wamp\sql\*