123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- #!/bin/bash
- source ~/.bash_profile
- source ~/.bashrc
- conda activate tf2
- cd /data/UserReturn
- #1. download data
- nowday=`date +"%Y%m%d" -d -0days`
- last7day=`date +"%Y%m%d" -d -1days`
- nowhour=`date +"%Y%m%d%H" -d -1hours`
- echo ${nowday}
- echo ${last7day}
- mkdir -p ./data/
- mkdir -p ./logs/
- #conda activate py36
- python extract_share_log.py ${last7day} ${nowday}
- if [ $? -ne 0 ];
- then
- msg = "[ERROR] simrecall extract_share_log"
- #sh sendmsg.sh $nowday $msg
- echo "[ERROR] echo 'extract_share_log"
- exit 255
- fi
- python extract_clik_log.py ${last7day} ${nowday}
- if [ $? -ne 0 ];
- then
- msg = "[ERROR] simrecall extract_share_log"
- #sh sendmsg.sh $nowday $msg
- echo "[ERROR] echo 'extract_share_log"
- exit 255
- fi
- python groupItem.py ${nowday}
- if [ $? -ne 0 ];
- then
- msg = "[ERROR] simrecall extract_share_log"
- #sh sendmsg.sh $nowday $msg
- echo "[ERROR] echo 'extract_share_log"
- exit 255
- fi
- python extract_user_exp_video.py ${last7day} ${nowday}
- if [ $? -ne 0 ];
- then
- msg = "[ERROR] simrecall extract_share_log"
- #sh sendmsg.sh $nowday $msg
- echo "[ERROR] echo 'extract_share_log"
- exit 255
- fi
- python getI2I.py ./data/user_video_exp_${nowday} ./data/return_item_${nowday} ./data/i2i_${nowday}
- if [ $? -ne 0 ];
- then
- msg = "[ERROR] simrecall extract_share_log"
- #sh sendmsg.sh $nowday $msg
- echo "[ERROR] echo 'extract_share_log"
- exit 255
- fi
- python calReturn.py ${nowday}
- if [ $? -ne 0 ];
- then
- msg = "[ERROR] simrecall extract_share_log"
- #sh sendmsg.sh $nowday $msg
- echo "[ERROR] echo 'extract_share_log"
- exit 255
- fi
- python getI2ICTRGroup.py ./data/user_video_exp_${nowday} ./data/user_item_return_count_${nowday} ./data/i2i_${nowday} ./data/i2i_group_ctr_${nowday}
- if [ $? -ne 0 ];
- then
- msg = "[ERROR] simrecall extract_share_log"
- #sh sendmsg.sh $nowday $msg
- echo "[ERROR] echo 'extract_share_log"
- exit 255
- fi
- python import_redist.py ./data/i2i_group_ctr_${nowday} ./data/return_video_rec_${nowday}
- python getI2ICTRGroupV2.py ./data/user_video_exp_${nowday} ./data/user_item_return_count_${nowday} ./data/i2i_${nowday} ./data/i2i_group_ctr_v2_${nowday}
- if [ $? -ne 0 ];
- then
- msg = "[ERROR] simrecall extract_share_log"
- #sh sendmsg.sh $nowday $msg
- echo "[ERROR] echo 'extract_share_log"
- exit 255
- fi
- python import_redist_v2.py ./data/i2i_group_ctr_v2_${nowday} ./data/return_video_rec_v2_${nowday}
- day="$(date -d '40 days ago' +%Y-%m-%d)"
- pattern="/data/UserReturn/data/*${day}*"
- if compgen -G "$pattern" > /dev/null; then
- find "$base_path" -name "${day}*" -exec rm -rf {} \;
- echo "delete done"
- else
- echo "no data"
- fi
|