启动脚本

startup.sh

#!/bin/bash
x=$(($1))
while (($x>0))
do
    java -jar /home/chenpenghui/crawler/crawler-hb/StartUpIp.jar &
    sleep 3
    x=$(($x-1))
done

线程数 等于 输入值 

启动如下 

./startup.sh 10

 停止脚本

clean.sh

#!/bin/bash
kill -9 `ps ax|grep /home/chenpenghui/crawler/crawler-hb/StartUpIp.jar|awk '{print $1}'`

./clean.sh

 

查看进程 

ps aux|grep java

相关文章:

  • 2022-12-23
  • 2021-12-19
  • 2022-02-08
  • 2021-06-11
  • 2022-12-23
  • 2021-12-19
  • 2022-12-23
猜你喜欢
  • 2021-12-19
  • 2022-12-23
  • 2022-01-13
  • 2022-12-23
  • 2021-12-19
  • 2021-12-24
相关资源
相似解决方案