run.sh 970 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/bash
  2. source ~/.bash_profile
  3. source ~/.bashrc
  4. conda activate python36
  5. cd /home/rec/project/git_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. mkdir -p ./logs/
  13. #conda activate py36
  14. python extract_share_log.py ${last7day} ${nowday}
  15. if [ $? -ne 0 ];
  16. then
  17. msg = "[ERROR] simrecall extract_share_log"
  18. sh sendmsg.sh $nowday $msg
  19. echo "[ERROR] echo 'extract_share_log"
  20. exit 255
  21. fi
  22. #nowday='20230505'
  23. #2. cal i2i result
  24. python calI2I.py ${nowday}
  25. if [ $? -ne 0 ];
  26. then
  27. msg = "[ERROR] simrecall calI2I.py"
  28. sh sendmsg.sh $nowday $msg
  29. echo $msg
  30. exit -1
  31. fi
  32. #3.import res
  33. python import_redist.py "./data/rec_result_"${nowday}".json" "./data/redis_cls_"${nowday}".json"
  34. if [ $? -ne 0 ];
  35. then
  36. msg = "[ERROR] simhot recall import_redist.py"
  37. sh sendmsg.sh $nowday $msg
  38. echo $msg
  39. exit -1
  40. fi
  41. echo 'finish sorted'