learning shell monitor prog function
【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的更多相关文章
- learning shell display alert function
[Purpose] Shell print function base on err info wrn ext output level [Eevironment] U ...
- learning shell built-in variables (1)
Shell built-in variables [Purpose] Learning shell built-in variables, example $0,$1,$2,$3,$#, ...
- learning shell args handing key=value example (2)
Shell args handing key=value example [Purpose] Learning how to handing ker=value args [Eevi ...
- learning shell script prompt to run with superuser privileges (4)
Shell script prompt to run with superuser privileges [Purpose] Check whether have root privil ...
- learning shell get script absolute path (3)
Shell get script absolute path [Purpose] Get shell script absolute path [Eevironment] ...
- learning shell check requires root privileges
[Purpose] Shell script check requires root privileges [Eevironment] Ubuntu 16.04 bas ...
- learning shell check host dependent pkg
[Purpose] Shell script check host dependent pkg [Eevironment] Ubuntu 16.04 bash env ...
- Unsupervised Learning: Use Cases
Unsupervised Learning: Use Cases Contents Visualization K-Means Clustering Transfer Learning K-Neare ...
- shell 实例
转载自:https://github.com/liquanzhou/ops_doc 这里只作为笔记使用,不做他用 shell实例手册 0 说明{ 手册制作: 雪松 更新日期: 2018-09-1 ...
随机推荐
- 初步学习async/await,Task.GetAwaiter,Task.Result
网上关于async/await的知识有很多,看了很多但不如自己实践一遍来得快,所以这里记录下我的理解和大家学习下. 首先以最简单的同步方法来开始如下 private static void Test( ...
- Java 8 HashMap 源码解析
HashMap 使用数组.链表和红黑树存储键值对,当链表足够长时,会转换为红黑树.HashMap 是非线程安全的. HashMap 中的常量 static final int DEFAULT_INIT ...
- C#事件和委托(C#学习笔记03)
委托 1. C# 中的委托类似于 C 或 C++ 中指向函数的指针.委托表示引用某个方法的引用类型变量,运行时可以更改引用对象. 2. 特别地,委托可以用于处理事件或回调函数.并且,所有的委托类都是从 ...
- Django---静态文件配置,post提交表单的csrf问题(日后细说),创建app子项目和分析其目录,ORM对象关系映射简介,Django操作orm(重点)
Django---静态文件配置,post提交表单的csrf问题(日后细说),创建app子项目和分析其目录,ORM对象关系映射简介,Django操作orm(重点) 一丶Django的静态文件配置 #we ...
- [摘录]flutter打包后无法访问接口
打开文件{{flutterPorject}}\android\app\src\main\AndroidManifest.xml这个文件增加权限信息: <uses-permission andro ...
- expor和import的用法
1.Export 模块是独立的文件,该文件内部的所有的变量外部都无法获取.如果希望获取某个变量,必须通过export输出 // profile.js export var firstName = 'M ...
- ajax往后台传值的一些方式
$('#del1').click(function () { $.ajax({ url: 'http://localhost:8089/test1', data: {a: 1, b: 2}, type ...
- layui 表格中实现照片预览,点击查看原图
人员表格中实现照片预览,并且可点击放大.查看原图 <table id="dutyInfoTable" class="layui-hide">< ...
- js中函数的参数为函数的情况即回调函数
js中函数的参数可以是数组对象也可以是函数,当参数为函数时我们叫做回调函数 //定义回调函数function B() { console.log("函数B")setTimeout( ...
- sendMessage 与 obtainMessage (sendToTarget)比较
我们平时在做到多线程问题的时候可能利用Handler去传递Message,其中,经常使用的就是 1.new Handler().obtainMessage().sendToTarget(); 2.ne ...