shell脚本
#!/bin/bash
##
# author 刘云生
##
# 获取所有的application数量
app_nums=`yarn application -list | wc -l `
echo "app_nums: $app_nums"
apps=`yarn application -list | awk '{print $1}'|head -$app_nums | tail -n 100`
echo "apps: $apps"
for app in $apps
do
if [ "$app" != "Application-Id" ];then
echo "$app is killing"
yarn application -kill $app
fi
done