From 6c63fb83eff24e9e72c44da007e230bd5e320c0b Mon Sep 17 00:00:00 2001 From: hanhh <18330117883@163.com> Date: Fri, 9 Jul 2021 18:28:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=A7=E8=A1=8C=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E6=97=B6task=5Fbefore=E5=87=BA=E9=94=99=E9=80=A0?= =?UTF-8?q?=E6=88=90=E4=BB=BB=E5=8A=A1=E6=97=A5=E5=BF=97=E4=B8=AD=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shell/task.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/shell/task.sh b/shell/task.sh index ee922618..565eb300 100755 --- a/shell/task.sh +++ b/shell/task.sh @@ -91,11 +91,15 @@ run_normal() { local begin_time=$(date '+%Y-%m-%d %H:%M:%S') echo -e "## 开始执行... $begin_time\n" | tee -a $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 - . $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" local end_time=$(date '+%Y-%m-%d %H:%M:%S') local diff_time=$(($(date +%s -d "$end_time") - $(date +%s -d "$begin_time")))