关于编写自动调度脚本遇到的问题

发布时间 2023-09-22 14:27:22作者: 与时代共同进步

需求 将入库的stg层表中日指标历史数据同步到dwd层,之前的日指标数据账期从20230820到20230918

1.echo 输出变量

导入配置文件

最后的结果

#! /bin/bash
source ~/.bashrc
source ~/.bash_profile
source /etc/profile

start_date=20230820
end_date=20230918

current_date=$start_date
cd /home/asiainfo/workspace/python3/apps
while [[ $current_date -le $end_date ]]
do
    python3 p_dw_d_kpi_index_value_lengthways_pbp0100034.py $current_date
    echo "${current_date}已处理">> zyz_0922_2.log 
    current_date=$(date -d "$current_date + 1 day" +%Y%m%d)
done