shell脚本--重启nohup后台运行的程序

版权声明:使用中有任何问题,可以留言。能解答尽量解答。 https://blog.csdn.net/liyyzz33/article/details/87094595

例子:

重启filebeat

#!/bin/bash

pid=`ps -ef | grep "filebeat" | grep php_api.yml | awk '{printf $2}'`
echo $pid

kill -9 $pid

cd /data/logs/

nohup /data/elk/filebeat-6.0.0/filebeat -e -c /data/elk/filebeat-6.0.0/php_api.yml &

猜你喜欢

转载自blog.csdn.net/liyyzz33/article/details/87094595