linfan 2 gadi atpakaļ
vecāks
revīzija
85f4e41443
3 mainītis faili ar 63 papildinājumiem un 4 dzēšanām
  1. 14 2
      run.sh
  2. 13 2
      run_ctr.sh
  3. 36 0
      sendmsg.sh

+ 14 - 2
run.sh

@@ -14,6 +14,8 @@ mkdir -p ./data/
 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
@@ -21,9 +23,19 @@ fi
 #2. cal i2i result
 python calI2I.py ${nowday}
 then
-    echo "[ERROR] echo 'calI2I"
-    exit 255
+    msg = "[ERROR] simrecall calI2I.py"
+    sh sendmsg.sh $nowday $msg
+    echo $msg
+    exit -1
 fi
 
 #3.import res
 python import_redist.py "./data/rec_result_"${nowday}".json"
+if [ $? -ne 0 ];
+then
+    msg = "[ERROR] simhot recall import_redist.py"
+    sh sendmsg.sh  $nowday  $msg
+    echo $msg
+    exit -1
+fi
+echo "finish sorted"

+ 13 - 2
run_ctr.sh

@@ -13,8 +13,19 @@ mkdir -p ./data/
 python export_vid.py  ${nowday}
 if [ $? -ne 0 ];
 then
-    echo "[ERROR] echo 'extract_share_log"
+    msg = "[ERROR] sorted extract_vid_log"
+    sh sendmsg.sh  $nowday  $msg
+    echo "[ERROR] echo 'extract_vid.py"
     exit 255
 fi
 
-python calCtr.py ${nowday} 
+python calCtr.py ${nowday}
+if [ $? -ne 0 ];
+then
+    msg = "[ERROR] cal ctr "
+    sh sendmsg.sh  $nowday  $msg
+    echo "[ERROR] echo 'calCtr.py"
+    exit 255
+fi
+echo "finish sorted"
+

+ 36 - 0
sendmsg.sh

@@ -0,0 +1,36 @@
+#!/bin/bash
+nowdate=$1
+content=${@:2}
+content=${content//\<font color=\'red\'\>/}
+content=${content//\<\/font\>\<\/br\>/}
+content=${content//\ /}
+echo "warn content is : $content"
+
+api=https://open.feishu.cn/open-apis/bot/v2/hook/00cf9bb4-ecea-4f0d-bf02-1a20592a916c #飞书机器人webhook 地址
+
+
+curl -X POST \
+  $api \
+  -H 'Content-Type: application/json' \
+  -d '{
+    "msg_type": "post",
+    "content": {
+        "post": {
+            "zh_cn": {
+                "title": "recall alert",
+                "content": [
+                    [
+                        {
+                            "tag": "text",
+                            "un_escape": true,
+                            "text": "'$content'"
+                        }
+                    ],
+                    [
+
+                    ]
+                ]
+            }
+        }
+    }
+}'