美文网首页
检测脚本是否执行shell命令

检测脚本是否执行shell命令

作者: 张清柏 | 来源:发表于2021-05-07 18:39 被阅读0次

检测脚本是否执行,如果没有执行则开启

#!/bin/bash
#ps -ef |grep TxCommand 这个就是看TxCommand的启动情况
#grep -v "grep" 是为了去掉查询 grep的那一条
#wc -l 是计数的

COUNT=$(ps -ef |grep cnkang_test/web/admin/script/ugc/ugc_video_tx_make.php |grep -v "grep" |wc -l)
echo $COUNT
if [ $COUNT -eq 0 ]; then
        echo NOT RUN
         /cnk_data/cnk_site/cnkang_test/web/admin/script/ugc/sticker/sticker_video_test.sh
else
        echo is RUN
fi
#!/bin/bash
#ps -ef |grep TxCommand 这个就是看TxCommand的启动情况
#grep -v "grep" 是为了去掉查询 grep的那一条
#wc -l 是计数的

COUNT=$(ps -ef |grep cnkang_test/web/admin/script/ugc/ugc_video_tx_make.php |grep -v "grep" |wc -l)
echo $COUNT
if [ $COUNT -eq 0 ]; then
        echo NOT RUN
         /cnk_data/cnk_site/cnkang_test/web/admin/script/ugc/sticker/sticker_video_test.sh
else
        echo is RUN
fi[root@bj-ffmpeg-dev-01 fodderMake]# cat  /cnk_data/cnk_site/cnkang_test/web/admin/script/ugc/sticker/sticker_video_test.sh
#!/bin/bash
# nohup your_command > nohupdate +%Y-%m-%d.out 2>&1 &
/bin/nohup  php  /cnk_data/cnk_site/cnkang_test/web/admin/script/ugc/ugc_video_tx_make.php >> /tmp/fodderMake/log`date +'%Y-%m-%d'`.log  2>&1   & 

相关文章

网友评论

      本文标题:检测脚本是否执行shell命令

      本文链接:https://www.haomeiwen.com/subject/nhjedltx.html