原文:用shell脚本监控进程是否存在 不存在则启动的实例

用shell脚本监控进程是否存在 不存在则启动的实例,先上代码干货: bin shps fe grep processString grep v grepif ne thenecho start process..... elseecho runing..... fi processString 表示进程特征字符串,能够查询到唯一进程的特征字符串 表示存在的 ne 不存在, eq 存在 定时执行: ...

2013-08-26 13:04 0 83664 推荐指数:

查看详情

shell脚本的if语句,判断某程序是否存在不存在启动该程序!

想必大家都知道 “如果......那么......“ 这种语法的应用吧! 当然呢,linux下对于这种用法也是有所考虑的,很多时候我们都需要写一个shell脚本,难免会避免if语句。 例如:判断Apache是否运行(httpd已安装),否!则启动Apache: 思路 ...

Tue Dec 12 01:19:00 CST 2017 1 5352
linux shell脚本监控进程是否存在

shell脚本监控进程是否存在 不存在启动实例,先上代码干货: #!/bin/shps -fe|grep processString |grep -v grepif [ $? -ne 0 ]thenecho "start process....."elseecho ...

Tue Nov 27 01:19:00 CST 2018 0 879
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM