|
@@ -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
|