Linux Script to check if process is running and act on the result

前端 未结 7 1864
孤独总比滥情好
孤独总比滥情好 2020-11-29 23:38

I have a process that fails regularly & sometimes starts duplicate instances..

When I run: ps x |grep -v grep |grep -c \"processname\" I will get: <

7条回答
  •  -上瘾入骨i
    2020-11-30 00:37

    The 'pidof' command will not display pids of shell/perl/python scripts. So to find the process id’s of my Perl script I had to use the -x option i.e. 'pidof -x perlscriptname'

提交回复
热议问题