设计思想:编写批处理脚本监控进程的运行状态,如果发现进程停止,则自动重启该进程.批处理脚本(jk.bat)和进程脚本(hello.bat)如下: 1.jk.bat @echo off rem 定义需监控程序的进程名和程序路径,可根据需要进行修改 set AppName=myHello.jar set AppPath=C:\Users\dongbr\Desktop\test\ title 进程监控 cls echo. echo 进程监控开始…… echo. rem 定义循环体 :startjc r…
#!/bin/sh MAXRSTCOUNT=; PROCTOGO=/mnt/hgfs/code/test/show #count is the counter of test started times count= sys_reboot() { echo "system is going to reboot"; reboot; } main_loop() { while : do ######################################### ProStillRu…