shell ip循环样例

    xiaoxiao2021-12-14  14

    #! /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
    转载请注明原文地址: https://ju.6miu.com/read-965594.html

    最新回复(0)