zoukankan      html  css  js  c++  java
  • check if a linux process is done using bash 检查进程是否在运行

    # cat > check_process_is_end.sh


    while true
    do
       sleep 30 # seconds
       res=`ps -ef | grep RNAhybrid`
       count=`grep -o "RNAhybrid" <<<"$res" | wc -l`
       if [ "$count" -eq "1" ] ; then
            echo $res
            echo -en "07"
            sleep 1        
            echo -en "07"  
            sleep 1        
            echo -en "07"  
       fi
    done


    # chmod u+x check_process_is_end.sh
    # ./check_process_is_end.sh

    NOTE: RNAhybrid is a process name.

    #======================

    # 监控某个进程运行时占用的内存

    #======================

    # cat > process_memory.sh


    while true
    do
       sleep 30 # seconds
       res=`ps aux | grep -w "RNAhybrid"`

       date >> mylogs
       echo $res >> mylogs
    done


    # chmod u+x process_memory.sh
    # ./process_memory.sh

    NOTE: RNAhybrid is a process name.
     

  • 相关阅读:
    Periodic Strings ( UVA
    Digit Counting ( UVA
    Molar mass ( UVA
    Score ( UVA
    Let the Balloon Rise (STL)
    Tree Recovery (STL)
    安卓simpleadapter问题
    安卓活跃手指问题
    python 问题记录
    设计模式笔记
  • 原文地址:https://www.cnblogs.com/emanlee/p/3872664.html
Copyright © 2011-2022 走看看