#!/bin/bash startDate=$1 endDate=$2 startSec=`date -d "$startDate" "+%s"` endSec=`date -d "$endDate" "+%s"` source /etc/profile.d/saga_env.sh for((i=$startSec;i<=$endSec;i+=86400)) do current_day=`date -d "@$i" "+%Y-%m-%d"` one_day_ago=`date -d "$current_day yesterday" +%Y%m%d` start_time=`date -d "0 day $current_day" +%Y%m%d`000000 end_time=`date -d "1 day $current_day" +%Y%m%d`000000 energy_start_time=`date -d "-1 day $current_day" +%Y%m%d`160000 energy_end_time=`date -d "-0 day $current_day" +%Y%m%d`160000 echo current_day:$current_day echo start_time:${start_time} echo end_time:${end_time} echo "**************************************" echo energy_start_time:${energy_start_time} echo energy_end_time:${energy_end_time} /usr/local/bin/python3 /opt/app/python_transfer/start_mysql.py 10101 --start_time $energy_start_time --end_time $energy_end_time sh /opt/app/bi-app/energy/dayTask/mysql_to_hdfs.sh ods_energy_15_min $current_day ssh hadoop01 sh /opt/app/bi-app/energy/dayTask/ods_to_dwd.sh all $current_day ssh hadoop01 sh /opt/app/bi-app/energy/dayTask/clean_mysql.sh clean_energy_15 $current_day sh /opt/app/bi-app/energy/dayTask/hdfs_to_mysql.sh app_energy_day $current_day done