run_hour.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #!/bin/bash
  2. source ~/.bash_profile
  3. source ~/.bashrc
  4. conda activate tf2
  5. cd /data/SimRecall
  6. #1. download data
  7. nowday=`date +"%Y%m%d" -d -0days`
  8. last7day=`date +"%Y%m%d" -d -15days`
  9. echo ${nowday}
  10. echo ${last7day}
  11. mkdir -p ./data/
  12. mkdir -p ./logs/
  13. #conda activate py36
  14. nowhour=`date +"%Y%m%d%H" -d -0days`
  15. nowstart=$nowday'000000'
  16. nowhour=${nowhour}'0000'
  17. #nowhour='20230601140000'
  18. echo $nowhour
  19. echo ${nowstart}
  20. echo ${last7day}
  21. python extract_cur_share_log.py ${nowstart} ${nowhour}
  22. if [ $? -ne 0 ];
  23. then
  24. msg = "[ERROR] simrecall extract_share_log"
  25. sh sendmsg.sh $nowday $msg
  26. echo "[ERROR] echo 'extract_share_log"
  27. exit 255
  28. fi
  29. python filter_video.py ./data/user_cur_day_item_share_${nowhour} ./data/user_cur_day_item_share_filter_${nowhour}
  30. #python extract_share_log.py ${last7day} ${nowday}
  31. if [ $? -ne 0 ];
  32. then
  33. msg = "[ERROR] simrecall extract_share_log"
  34. sh sendmsg.sh $nowday $msg
  35. echo "[ERROR] echo 'extract_share_log"
  36. exit 255
  37. fi
  38. #nowday='20230505'
  39. #2. cal i2i result
  40. python calI2I2.py ${nowday} ${nowhour}
  41. if [ $? -ne 0 ];
  42. then
  43. msg = "[ERROR] simrecall calI2I.py"
  44. #sh sendmsg.sh $nowday $msg
  45. echo $msg
  46. exit -1
  47. fi
  48. #3.import res
  49. python import_redist.py "./data/rec_result3_"${nowhour}".json" "./data/redis_cls_"${nowhour}".json"
  50. if [ $? -ne 0 ];
  51. then
  52. msg = "[ERROR] simhot recall import_redist.py"
  53. sh sendmsg.sh $nowday $msg
  54. echo $msg
  55. exit -1
  56. fi
  57. echo 'finish sorted'