run.sh 919 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/bash
  2. source ~/.bash_profile
  3. source ~/.bashrc
  4. conda activate base
  5. cd /data/rec_project/OffLineRec
  6. #1. download data
  7. nowday=`date +"%Y%m%d" -d -0days`
  8. last7day=`date +"%Y%m%d" -d -8days`
  9. echo ${nowday}
  10. echo ${last7day}
  11. mkdir -p ./data/
  12. python extract_share_log.py ${last7day} ${nowday}
  13. if [ $? -ne 0 ];
  14. then
  15. msg = "[ERROR] simrecall extract_share_log"
  16. #sh sendmsg.sh $nowday $msg
  17. echo "[ERROR] echo 'extract_share_log"
  18. exit 255
  19. fi
  20. #nowday='20230505'
  21. #2. cal i2i result
  22. python calI2I.py ${nowday}
  23. if [ $? -ne 0 ];
  24. then
  25. msg = "[ERROR] simrecall calI2I.py"
  26. #sh sendmsg.sh $nowday $msg
  27. echo $msg
  28. exit -1
  29. fi
  30. #3.import res
  31. python import_redist.py "./data/rec_result_"${nowday}".json" "./data/redis_cls_"${nowday}".json"
  32. if [ $? -ne 0 ];
  33. then
  34. msg = "[ERROR] simhot recall import_redist.py"
  35. #sh sendmsg.sh $nowday $msg
  36. echo $msg
  37. exit -1
  38. fi
  39. echo 'finish sorted'