#!/bin/bash
stime=$1
etime=$2
cl_start_time=$(date -d "${stime} 8 hours ago" "+%Y-%m-%d %H:%M:%S")
t1=$(date -d "${cl_start_time}" "+%Y%m%d%H%M%S")
while [[ $(date -d "${stime}" +%s) -le $(date -d "${etime}" +%s) ]]; do
#插值入库开始时间
cur_time=$(date -d "${stime} 8 hours ago" "+%Y-%m-%d %H:%M:%S")
#插值入库结束时间
next_time=$(date -d "${cur_time} 10 mins" "+%Y-%m-%d %H:%M:%S")
#评估时间
pg_time=$(date -d "${stime} 10 mins" "+%Y-%m-%d %H:%M:%S")
s1=$(date -d "${cur_time}" "+%Y%m%d%H%M%S")
s2=$(date -d "${next_time} 1 second ago" "+%Y%m%d%H%M%S")
echo ${s1}
echo ${s2}
echo ${next_time}
# 开始执行插值、解析、入库
echo "sh /home/cy/parse/scripts/v2_local.sh ${s1},${s2}"
sh /home/cy/parse/scripts/v2_local.sh ${s1},${s2}
wait
echo "sh /home/cy/ass/twoMin.sh ${pg_time} $3"
cd /home/cy/ass/ && sh /home/cy/ass/twoMin.sh ${pg_time} $3
echo "10分钟评估结束:时间为:${pg_time}"
ymd=$(date -d "$pg_time" +"%d")
hm=$(date -d "$pg_time" +"%H:%M")
echo ${ymd} ${hm}
if [[ ${hm} = "00:00" ]]; then
echo "日评估 sh /home/cy/ass/twoDay.sh ${pg_time} $4"
cd /home/cy/ass/ && sh /home/cy/ass/twoDay.sh ${pg_time} $4
if [[ ${ymd} = "01" ]]; then
echo "月评估 sh /home/cy/ass/twoMonth.sh ${pg_time} $5"
cd /home/cy/ass/ && sh /home/cy/ass/twoMonth.sh ${pg_time} $5
wait
echo "cd /home/cy/clearData/ && sh /home/cy/clearData/twoNow.sh ${t1},${s2}"
cd /home/cy/clearData/ && sh /home/cy/clearData/twoNow.sh ${t1},${s2}
fi
fi
# 将开始时间设置为下一个10分钟的开始时间
stime=${pg_time}
done
跑历史十分钟脚本,传入开始时间,结束时间
最新推荐文章于 2024-09-06 18:06:22 发布