工具从网络自行下载,目前我存储在网盘上,可下载后调用
- 更新包打包、创建md5,压缩成.zip
- 现有项目按日期备份
- 覆盖项目并做md5check
@echo off rem =================文件变量============================================= set zip=D: ools7za.exe set md5=D: oolsFileCheck_MD5.exe ::file_package cd /d %~pd0 %md5% -create %~pd0app -k %~pd0appmd5.txt %zip% a -tzip %~pd0app.zip %~pd0app -r ::项目app ::判断旧解压包是否存在,存在删除 ::更新包名:D:server_newapp.zip ::解压目录:D:server_newapp ::判断更新包是否存在,存在就解压更新包到指定目录 ::file_ready if exist "D:server_newapp" (rd /s /q D:server_newapp) >nul if not exist "D:server_newapp.zip" (exit) >nul if exist "D:server_newapp.zip" (%zip% x D:server_newapp.zip -oD:server_new) >nul ::file_backup ::exclude log files and/or folders echo .log > exclude.txt echo log >> exclude.txt xcopy /r /d /i /s /y /q /exclude:exclude.txt D:app D:server_bakapp"%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%" del exclude.txt ::file_update ::判断更新目录是否存在,更新目录:D:server_newapp ::若存在就将解压文件覆盖到指定目录 if not exist "D:app" (exit) if not exist "D:server_newapp" (exit) xcopy /r /d /i /s /y D:server_newapp D:app %md5% -check D:app -k D:server_newappmd5.txt > D:server_newmd5_check.log
- Mysqldump
set YMDT=%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%
mysqldump --opt -u root --password=passwd db > D:dbbakdb_%YMDT%.sql