#! /bin/bash
# om需要在15分,30分沿后,45 分 或者 00分之后抓
# 最好是15:50或者16:00抓彪蓬, 同理 31:00, 46:00悲立, 01:00
commandVar=`jedi run -t test.yml`
echo "run yml"
cd /home/rvc/testcases/vG3_traffic/utils
run_min=`date +'%M'`
echo "now min:" $run_min
# -le? less eq
#? || $run_min -ge 01
while true
do
if [ $run_min -ge 16 ]; then
jedi run -t test.yml
echo "catch log============"
break;
else
tmp_min=$run_min
tmp_min=6
sleep_sec=($tmp_min-16)*60
echo "sleep min:" $sleep_sec
sleep $sleep_sec
fi
done
echo "==========shell ending============"
#!/bin/bash
echo "========================start run om yml========================"
run_min_1=01
run_min_2=16
run_min_3=31
run_min_4=46
while true; do
run_min=`date +%M`
? ? echo "========================current min is $run_min========================"
if [ $run_min -eq $run_min_1 -o $run_min -eq $run_min_2 -o $run_min -eq $run_min_3 -o $run_min -eq $run_min_4 ]; then
echo 'hello world!'
break
else
tmp_min_1=$[60+$run_min_1-$run_min]
tmp_min_1_=$[run_min_1-$run_min]
tmp_min_2=$[$run_min_2-$run_min]
tmp_min_3=$[$run_min_3-$run_min]
tmp_min_4=$[$run_min_4-$run_min]
echo "========================run min $run_min_1 interval is $tmp_min_1========================"
echo "========================run min $run_min_1 interval is $tmp_min_1_========================"
echo "========================run min $run_min_2 interval is $tmp_min_2========================"
echo "========================run min $run_min_3 interval is $tmp_min_3========================"
echo "========================run min $run_min_4 interval is $tmp_min_4========================"
tmp_min=$tmp_min_1
if [ $tmp_min_1 -gt 0 -a $tmp_min_1 -lt $tmp_min_2 ]; then
tmp_min=$tmp_min_1
elif [ $tmp_min_2 -gt 0 ]; then
tmp_min=$tmp_min_2
fi
if [ $tmp_min_1_ -gt 0 -a $tmp_min -gt $tmp_min_1_ ]; then
tmp_min=$tmp_min_1_
fi
if [ $tmp_min_3 -gt 0 -a $tmp_min -gt $tmp_min_3 ]; then
tmp_min=$tmp_min_3
fi
if [ $tmp_min_4 -gt 0 -a $tmp_min -gt $tmp_min_4 ]; then
tmp_min=$tmp_min_4
fi
if [ $tmp_min -gt 0 ]; then
echo "========================sleep $[tmp_min*60]========================"
sleep $[tmp_min*60]
fi
fi
done
echo "========================end run om yml========================"