windows監控腳本

windows下監控17100端口的jar包,斷掉重新啓動

@echo off
title Program monitoring
:again
set ip=127.0.0.1
set port=17100
netstat -ano|findstr %port%

if ERRORLEVEL 1 (goto err) else (goto ok)

:err
java -jar uap-register-server-1.0.jar --spring.config.location=application.properties --server.port=17100 
goto again

:ok
echo Program Services is running %Date:~0,4%-%Date:~5,2%-%Date:~8,2% %Time:~0,2%:%Time:~3,2%
goto again


 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章