赞
踩
JAR包的启动脚本
多个JAR包同时启动
@echo off echo. echo WebVR START... echo. :: 进入目录文件夹 d: cd D:\JT\java\workspace\webvr-end\deploy :: 执行多个javaw命令,但是无法输出日志 echo webvr-auth START... start javaw -jar -Dfile.encoding=utf-8 -Xms800m -Xmx1024m webvr-auth-1.0.5.jar echo webvr-gateway START... start javaw -jar -Dfile.encoding=utf-8 -Xms800m -Xmx1024m webvr-gateway-1.0.5.jar echo webvr-system START... start javaw -jar -Dfile.encoding=utf-8 -Xms800m -Xmx1024m webvr-system-1.0.5.jar echo webvr-vr START... start javaw -jar -Dfile.encoding=utf-8 -Xms800m -Xmx1024m webvr-vr-1.0.5.jar pause
单个JAR包启动,并输出日志
@echo off echo. echo WebVR START...[1/4] echo. :: 应用存放路径 set deploy_path = D:\JT\java\workspace\webvr-end\deploy :: 进入目录文件夹 d: echo cd deploy_path %deploy_path% cd %deploy_path% :: 执行命令 echo webvr-auth START... javaw -D'file.encoding=utf-8' -jar webvr-auth-1.0.5.jar 2>&1>webvr-auth.log pause
单个JAR包启动,并输出按天分割的日志
@echo off echo. echo WebVR START...[4/4] echo. :: 应用存放路径 set deploy_path = D:\JT\java\workspace\webvr-end\deploy :: 进入目录文件夹 d: echo cd deploy_path %deploy_path% cd %deploy_path% :: 执行命令 echo webvr-vr START... :: javaw -D'file.encoding=utf-8' -jar webvr-vr-1.0.5.jar 2>&1>webvr-vr.log javaw -D'file.encoding=utf-8' -jar webvr-vr-1.0.5.jar | D:\JT\java\workspace\webvr-end\deploy\cronolog\cronolog.exe D:\JT\java\workspace\webvr-end\deploy\log\webvr-vr-%%Y%%m%%d.log pause
JAR包的停止脚本
停止一个端口
@echo off
set port=20812
for /f "tokens=1-5" %%i in ('netstat -ano^|findstr ":%port%"') do (
echo kill the process %%m who use the port %port%
taskkill /pid %%m
)
停止多个端口
@echo off
set port=7910 9200 9201 9203
for /f "tokens=1-5" %%a in ('netstat -ano^|findstr ":%port%"') do (
echo PID:%%e is running,kill the process [%%e] who use the port [%%b]
taskkill /F /pid %%e
)
pause
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。