您的位置:首页 > 运维架构 > Shell

shell ip循环样例

2016-12-02 17:16 239 查看
#! /bin/sh
day1=`date +%Y%m%d%H0000 -d '-1 hours'`
day2=`date +%Y%m%d -d '-1 hours'`
day3=`date +%H00 -d '-1 hours'`
day5=`date +%Y%m%d%H0000 -d '-24 hours'`
day4=`date +%H -d '-1 hours'`
start=23
echo $day1,$day2,$day3,$day4

ip=()
for i in ${ip[@]}
do
{
echo ${i}
/opt/bi/push/pushPretreatment/pushPretreatmentBarrel.sh 300 15 /opt/bi/push/barrel/barrel_ /opt/bi/push/pushdata/Push_pushAuthLog_${day1}_${i}.txt $day2-$day3 $day2-$day3
}&
done
wait

/opt/bi/push/pushPretreatment/catAndPushPretreatment.sh 300 15 /opt/bi/push/barrel_${day2}-${day3} $day2-$day3 $day2-$day3
echo "end time: " `date`
wait
cd /opt/bi/push/pushdata/
rm /opt/bi/push/pushdata/Push_pushAuthLog_${day5}_*.txt
if [ $day4 == $start  ]
then
/opt/bi/push/pushPretreatment/lzopPushPretreatment.sh $day2-$day3 $day2-$day3
cd /opt/bi/push/barrel
rm -rf barrel*
cd /opt/bi/push/result
rm result_*
else
echo "not start"
fi
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: