run.sh 834 B

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