监控脚本程序
2016-03-29 09:51
211 查看
#!/bin/bash progress_path=/test jar_name=example.jar while : do p_pid=`ps -ef |grep $jar_name|grep -v grep |awk '{print $2}'` if [ "$p_pid" == "" ] then cd $progress_path t="`cat progress.dat`" sed -i "s/\(startTime\).*/\1 = $t/g" conf/conf.properties ./start.sh fi sleep 5s done
当程序停止后自动从progress.dat中读取参数赋值到conf/conf.properties中重新启动程序
相关文章推荐
- Centos7 安装 JDK8
- RabbitMQ (五)主题(Topic)
- centos命令
- centos6.6 源码安装Apache2.4
- Linux进阶之bash编程三
- Centos更改网卡设备名称为eth0,eth1等
- Linux重装系统后SSH登录失败
- Linux进阶之bash编程二
- Shell特殊字符
- shell awk sed实战
- Linux入门:VIM
- Linux之设备操作
- Jenkins(二)---jenkins之Git+maven+jdk+tomcat
- OpenCV特征检测出现Unhandled exception at……Access violation reading location 0x00000000.
- Linux进阶之bash编程基础一
- mac下用cornerstone,在update时提示the working copy is locked
- centos7 列出所有系统服务
- 多线程:NSOperation 的依赖使用
- 多线程:NSOperation 的高级功能
- 2016国产开源软件TOP100(Q1)