@echooff
settxt1=%date:~0,4%
::当前年
settxt2=%date:~5,2%
::当前月
settxt3=%date:~8,2%
::当前日
settxt4=%time:~0,2%
::当前小时
settxt5=%time:~3,2%
::当前分钟
settxt6=%time:~6,2%
::当前秒
setdate=%txt1%%txt2%%txt3%
settime=%txt4%%txt5%%txt6%
echo--------------------------------------------------
echo-------------正在执行MySQL数据库备份--------------
echo--------------------------------------------------
echo...
echo...
echo导出Database...
ifexist%date%.sqldel%date%.sql
c:Progr*mysqlbinmysqldump--add-drop-table-c-uroot-p-hlocalhostdbname>e:%date%.sql
echo...
echo...
ifexistdump%date%.7zdeldump%date%.7z
echo压缩文件...
7za.exea-t7zdump%date%.7z%date%.sql-mx9
echo...
echo...
echo删除临时文件
del%date%.sql
echo...
echo...
echo备份完成!
pause
【用bat实现定时执行任务的批处理文件】相关文章:
★ 关闭所有分区自动播放和恢复所有分区自动播放的cmd批处理