소스 검색

add other tasks

luojunhui 1 개월 전
부모
커밋
b0b74d1d54
1개의 변경된 파일10개의 추가작업 그리고 5개의 파일을 삭제
  1. 10 5
      sh/run_long_articles_job.sh

+ 10 - 5
sh/run_long_articles_job.sh

@@ -57,14 +57,15 @@ TASKS=(
   # 百度视频抓取
   "0 0 * * *|run_baidu_video_crawler|${LOG_DIR}/run_baidu_video_crawler/%Y-%m-%d.log"
   "0 12 * * *|run_baidu_video_crawler|${LOG_DIR}/run_baidu_video_crawler/%Y-%m-%d.log"
-  "40 19 * * *|run_baidu_video_crawler|${LOG_DIR}/run_baidu_video_crawler/%Y-%m-%d.log"
+  "52 19 * * *|run_baidu_video_crawler|${LOG_DIR}/run_baidu_video_crawler/%Y-%m-%d.log"
   # 外部服务号监测
   "0 10 * * *|run_outside_server_accounts_monitor|${LOG_DIR}/run_outside_server_accounts_monitor/%Y-%m-%d.log"
   "0 16 * * *|run_outside_server_accounts_monitor|${LOG_DIR}/run_outside_server_accounts_monitor/%Y-%m-%d.log"
+
   # 自动下架视频
   "30 9 * * *|run_get_off_videos|${LOG_DIR}/run_get_off_videos/%Y-%m-%d.log"
   "30 15 * * *|run_get_off_videos|${LOG_DIR}/run_get_off_videos/%Y-%m-%d.log"
-  "38 19 * * *|run_get_off_videos|${LOG_DIR}/run_get_off_videos/%Y-%m-%d.log"
+  "50 19 * * *|run_get_off_videos|${LOG_DIR}/run_get_off_videos/%Y-%m-%d.log"
 )
 
 ###################### 工具函数 ######################
@@ -144,9 +145,13 @@ cleanup_logs(){
 
   for task in "${TASKS[@]}"; do
     IFS='|' read -r cron_expr name log_tpl <<< "$task"
-    cron_match "$cron_expr" || continue
-    logfile=$(date +"$log_tpl")          # 渲染 %Y-%m-%d
-    start_task "$name" "$logfile"
+    if cron_match "$cron_expr"; then
+      log INFO "表达式 [$cron_expr] 匹配当前时间,准备触发任务 $name"
+      logfile=$(date +"$log_tpl")      # 渲染 %Y-%m-%d
+      start_task "$name" "$logfile"
+    else
+      log DEBUG "表达式 [$cron_expr] 未匹配,跳过任务 $name"
+    fi
   done
 
   cleanup_logs