18 lines
586 B
Bash
18 lines
586 B
Bash
|
|
#! /bin/bash
|
||
|
|
#storm任务停止脚本
|
||
|
|
function read_dir(){
|
||
|
|
for file in `ls $1` #注意此处这是两个反引号,表示运行系统命令
|
||
|
|
do
|
||
|
|
if [ -d $1"/"$file ] #注意此处之间一定要加上空格,否则会报错
|
||
|
|
then
|
||
|
|
read_dir $1"/"$file
|
||
|
|
else
|
||
|
|
docker exec nimbus storm kill $file -w 1
|
||
|
|
# /home/bigdata/apache-storm-1.0.2/bin/storm kill $file -w 1
|
||
|
|
echo $file #在此处处理文件即可
|
||
|
|
fi
|
||
|
|
done
|
||
|
|
}
|
||
|
|
#读取第一个参数 为配置文件目录名
|
||
|
|
read_dir $1
|