<code id='bnmlu'><strong id='bnmlu'></strong></code>
<acronym id='bnmlu'><em id='bnmlu'></em><td id='bnmlu'><div id='bnmlu'></div></td></acronym><address id='bnmlu'><big id='bnmlu'><big id='bnmlu'></big><legend id='bnmlu'></legend></big></address><dl id='bnmlu'></dl>

      1. <ins id='bnmlu'></ins><span id='bnmlu'></span>

          1. <tr id='bnmlu'><strong id='bnmlu'></strong><small id='bnmlu'></small><button id='bnmlu'></button><li id='bnmlu'><noscript id='bnmlu'><big id='bnmlu'></big><dt id='bnmlu'></dt></noscript></li></tr><ol id='bnmlu'><table id='bnmlu'><blockquote id='bnmlu'><tbody id='bnmlu'></tbody></blockquote></table></ol><u id='bnmlu'></u><kbd id='bnmlu'><kbd id='bnmlu'></kbd></kbd>
          2. <i id='bnmlu'><div id='bnmlu'><ins id='bnmlu'></ins></div></i>
            <i id='bnmlu'></i>
            <fieldset id='bnmlu'></fieldset>

            避免linux脚本多次运行

            • 时间:
            • 浏览:3
            • 来源:124软件资讯网

              #>vi runonce

              #/bin/bash
              ##判断有同名shell是否正在执行
              PG=`basename {GetProperty(Content)}`


              PN=`ps -ef | grep "$PG"| grep -v "grep" | awk 'BEGIN {a=0;} {a++;} END{print(a)}'`

              #若是没有重复实例  ,正常执行
              if [ $PN -le 0 ]
              then
              echo startup now!
              if [ -x {GetProperty(Content)} ]; then
              . {GetProperty(Content)}
              else
              echo excute access deny: {GetProperty(Content)}
              fi
              #若是已经有个实例在运行  ,退出本实例
              else
              echo already startup!
              exit 1;
              fi
              挪用runonce a.sh