启动脚本
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