mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 23:06:06 +08:00
修复执行任务时task_before出错造成任务日志中断
This commit is contained in:
parent
602ffdcd5a
commit
6c63fb83ef
|
@ -91,11 +91,15 @@ run_normal() {
|
||||||
local begin_time=$(date '+%Y-%m-%d %H:%M:%S')
|
local begin_time=$(date '+%Y-%m-%d %H:%M:%S')
|
||||||
echo -e "## 开始执行... $begin_time\n" | tee -a $log_path
|
echo -e "## 开始执行... $begin_time\n" | tee -a $log_path
|
||||||
[[ $id ]] && update_cron "\"$id\"" "0" "$$" "$log_path"
|
[[ $id ]] && update_cron "\"$id\"" "0" "$$" "$log_path"
|
||||||
. $file_task_before
|
echo -e "\n## task_before开始\n" | tee -a $log_path
|
||||||
|
. $file_task_before 2>&1 | tee -a $log_path
|
||||||
|
echo -e "\n## task_before结束" | tee -a $log_path
|
||||||
|
|
||||||
timeout $command_timeout_time $which_program $p1 2>&1 | tee -a $log_path
|
timeout $command_timeout_time $which_program $p1 2>&1 | tee -a $log_path
|
||||||
|
|
||||||
. $file_task_after
|
echo -e "\n## task_after开始\n" | tee -a $log_path
|
||||||
|
. $file_task_after 2>&1 | tee -a $log_path
|
||||||
|
echo -e "\n## task_after结束\n" | tee -a $log_path
|
||||||
[[ $id ]] && update_cron "\"$id\"" "1" "" "$log_path"
|
[[ $id ]] && update_cron "\"$id\"" "1" "" "$log_path"
|
||||||
local end_time=$(date '+%Y-%m-%d %H:%M:%S')
|
local end_time=$(date '+%Y-%m-%d %H:%M:%S')
|
||||||
local diff_time=$(($(date +%s -d "$end_time") - $(date +%s -d "$begin_time")))
|
local diff_time=$(($(date +%s -d "$end_time") - $(date +%s -d "$begin_time")))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user