记录shell调用python执行账期循环调度;
shell下时间处理链接:https://www.cnblogs.com/alsodzy/p/8403870.html
#!/bin/bash
end_date=`date -d "yesterday" +%Y%m%d`
echo "截止时间: ${end_date}"
start_date=`date +%Y1101`
echo "开始时间: ${start_date}"
while [[ ${start_date} -le ${end_date} ]]
do
date=${start_date}
startdateother=`date -d "+0 day ${date}" +%Y%m%d`
dateother=${startdateother}
echo "执行帐期: ${dateother}"
# 执行python命令
# yy02_02&hgp_cube.dwd_sys_log_weekreport
`python /python/python_code/etl_tools/bin/etl_exp_load.py -t ${dateother} -c d -p yy02_02`
# yy02_03&hgp_cube.dwd_sys_user_weekreport
`python /python/python_code/etl_tools/bin/etl_exp_load.py -t ${dateother} -c d -p yy02_03`
# yy02_04&hgp_cube.dwd_delivery_head_weekreport
`python /python/python_code/etl_tools/bin/etl_exp_load.py -t ${dateother} -c d -p yy02_04`
#echo ${dateother}
start_date=`date -d "+1 day ${date}" +%Y%m%d`
startdateother=`date -d "+1 day ${date}" +%Y%m%d`
done