Purpose

       Shell script monitor prog function

 

Eevironment

       Ubuntu 16.04 bash env

 

Procdeure

  Source code:

#!/bin/bash

while [ 1 ]
do
# get under /appServer/app directory prog numbers
nprogs=`ls -t /appServer/app | cut -d" " -f1 | wc -l`
#echo $nprogs if [ $nprogs -eq 0 ]
then
echo "not progs" > /dev/null
else
#echo "judge driver running status"
for i in `seq 1 $nprogs`
do
#echo $i
prog=`ls -t /appServer/app | cut -d" " -f1 | head -n"$i" | tail -n1`
#echo $prog
ps -ef | grep "$prog" | grep -q -v grep
if [ $? -ne 0 ];then
#/appServer/app/$prog > /dev/null &
/appServer/app/$prog &
fi
done
fi sleep 60 done

  

 

learning shell monitor prog function的更多相关文章

  1. learning shell display alert function

    [Purpose]        Shell print function base on err info wrn ext output level   [Eevironment]        U ...

  2. learning shell built-in variables (1)

    Shell built-in variables [Purpose]        Learning shell built-in variables, example $0,$1,$2,$3,$#, ...

  3. learning shell args handing key=value example (2)

    Shell args handing key=value example [Purpose]        Learning how to handing ker=value args   [Eevi ...

  4. learning shell script prompt to run with superuser privileges (4)

    Shell script prompt to run with superuser privileges [Purpose]        Check whether have root privil ...

  5. learning shell get script absolute path (3)

    Shell get script absolute path [Purpose]        Get shell script absolute path   [Eevironment]       ...

  6. learning shell check requires root privileges

    [Purpose]        Shell script check requires root privileges   [Eevironment]        Ubuntu 16.04 bas ...

  7. learning shell check host dependent pkg

    [Purpose]        Shell script check host dependent pkg   [Eevironment]        Ubuntu 16.04 bash env ...

  8. Unsupervised Learning: Use Cases

    Unsupervised Learning: Use Cases Contents Visualization K-Means Clustering Transfer Learning K-Neare ...

  9. shell 实例

    转载自:https://github.com/liquanzhou/ops_doc    这里只作为笔记使用,不做他用 shell实例手册 0 说明{ 手册制作: 雪松 更新日期: 2018-09-1 ...

随机推荐

  1. 解决新版本R3.6.0不能加载devtools包问题

    首先是看到下面这个文章想试着练习一下,结果第一步就卡住了,无法加载devtools包,繁体字都冒出来了......汗!(没有截图,但过程痛苦不堪~) https://www.sohu.com/a/12 ...

  2. C#条码生成及打印实例代码

    ";//条码 ; ; //打印按钮 private void button1_Click(object sender, EventArgs e) { //实例化打印对象 PrintDocum ...

  3. wangeditor视频

    wangeditor网址http://www.wangeditor.com/ 目前使用的是3.11版本 使用步骤 1.引用wangEditor.min.js 2.代码 2.1 取得函数var E = ...

  4. 异常详细信息: System.Security.SecurityException: 未找到源,不过,未能搜索部分或所有事件日志。 若要创建源,您需要用于读取所有事件日志的权限以确保新的源名称是唯一的。 不可访问的日志: Security。

    “/”应用程序中的服务器错误. 安全性异常 说明: 应用程序尝试执行安全策略不允许的操作.要授予此应用程序所需的权限,请与系统管理员联系,或在配置文件中更改该应用程序的信任级别. 异常详细信息: Sy ...

  5. Spring Boot 框架下使用MyBatis访问数据库之基于XML配置的方式

    MyBatis 是一款优秀的持久层框架,它支持定制化 SQL.存储过程以及高级映射.MyBatis 避免了几乎所有的 JDBC 代码和手动设置参数以及获取结果集.MyBatis 可以使用简单的 XML ...

  6. vuex简单化理解和安装使用

     1.简单化理解 首先你要明白 vuex 的目的 就是为了 集中化的管理项目中 组件所有的 数据状态 (state) 0. 第一步你要明白 , store 的重要性 , store 类似一个中央基站, ...

  7. 【开发笔记】- 修改tomcat默认的编码方式

    tomcat8以后默认编码格式是utf-8:7之前的都是iso8859-1 如果默认情况下,tomcat使用的的编码方式:iso8859-1 修改tomcat下的conf/server.xml文件 找 ...

  8. 在微信小程序中使用redux

    本文主要讲述,在微信小程序中如何使用redux DEMO 需要解决的问题 如何在小程序中引入redux状态管理库,及它相关的插件? 微信小程序没有清晰的异步api,便于thunkMiddleware处 ...

  9. Django:RestFramework之-------解析器

    7.解析器 依靠Content-Type对用户的请求体中的数据进行解析. 7.1django中的解析器 前戏:django中的request.POST/request.body request.POS ...

  10. Python之路(第四十四篇)线程同步锁、死锁、递归锁、信号量

    在使用多线程的应用下,如何保证线程安全,以及线程之间的同步,或者访问共享变量等问题是十分棘手的问题,也是使用多线程下面临的问题,如果处理不好,会带来较严重的后果,使用python多线程中提供Lock ...