欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

mysql自动备份跟压缩

程序员文章站 2022-06-11 20:42:56
...

mysql自动备份和压缩 set Today=%date:~0,4%%date:~5,2%%date:~8,2% set filename=mzo-%Today% set source=D:\thwl\bak-sql\%filename%.sql forfiles /p "D:\thwl\bak-sql"? /m *.7z /d -15 /c "cmd /c del @path" mysqldump -uroot -pszk^^^^* -R MZO %sourc

mysql自动备份和压缩

set Today=%date:~0,4%%date:~5,2%%date:~8,2%
set filename=mzo-%Today%
set source=D:\thwl\bak-sql\%filename%.sql

forfiles /p "D:\thwl\bak-sql"? /m *.7z /d -15 /c "cmd /c del @path"
mysqldump -uroot -pszk^^^&^* -R MZO > %source%
HaoZipC a -t7z %filename%.7z %filename%.sql
del %filename%.sql