自动打包脚本

--在start-alluat.bat中
@echo on
@set HOST1=CTGQ3APP03
@set HOST2=CTGQ3APP04
@set SERVERNAME=new-sis
@set D_ROOT=%~dp0
@set LOGFOLDER=%~dp0logs
@call ..\..\wlp_cli_bin\env.bat

@call ..\..\wlp_cli_bin\stop-restart-server.bat %HOST1% start %SERVERNAME%>>%LOGFOLDER%\%startStopLogfile%
@call ..\..\wlp_cli_bin\stop-restart-server.bat %HOST2% start %SERVERNAME%>>%LOGFOLDER%\%startStopLogfile%
@type %LOGFOLDER%\%startStopLogfile%
:end

--在env.bat中

:: Use WMIC to retrieve date and time
@echo off
FOR /F "skip=1 tokens=1-6" %%G IN ('WMIC Path Win32_LocalTime Get Day^,Hour^,Minute^,Month^,Second^,Year /Format:table') DO (
   IF "%%~L"=="" goto s_done
      Set _yyyy=%%L
      Set _mm=00%%J
      Set _dd=00%%G
      Set _hour=00%%H
      SET _minute=00%%I
    SET _second=00%%K
)
:s_done
:: Pad digits with leading zeros
@Set _mm=%_mm:~-2%
@Set _dd=%_dd:~-2%
@Set _hour=%_hour:~-2%
@Set _minute=%_minute:~-2%
@Set _second=%_second:~-2%
:: Display the date/time in ISO 8601 format:
@Set datetimeStr=%_yyyy%%_mm%%_dd%%_hour%%_minute%%_second%
@set startStopLogfile=stop-start_%datetimeStr%.log
@set deployLogfile=deploy_%datetimeStr%.log
@set pluginGenerateLogfile=pluginGenerate_%datetimeStr%.log



猜你喜欢

转载自blog.csdn.net/qq_35255384/article/details/79073679
今日推荐