From 82494a87aff37425ece26bd4a7079cacebff0c06 Mon Sep 17 00:00:00 2001 From: hanhh <18330117883@163.com> Date: Sun, 22 Aug 2021 20:54:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9task.sh=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shell/task.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/shell/task.sh b/shell/task.sh index 52555c30..67a77810 100755 --- a/shell/task.sh +++ b/shell/task.sh @@ -91,11 +91,11 @@ run_normal() { [[ "$show_log" == "true" ]] && cmd="" make_dir "$log_dir" - local id=$(cat $list_crontab_user | grep -E "$cmd_task $first_param" | perl -pe "s|.*ID=(.*) $cmd_task $first_param\.*|\1|" | head -1 | awk -F " " '{print $1}') local begin_time=$(date '+%Y-%m-%d %H:%M:%S') eval echo -e "\#\# 开始执行... $begin_time\\\n" $cmd eval cat $task_error_log_path $cmd + local id=$(cat $list_crontab_user | grep -E "$cmd_task $first_param" | perl -pe "s|.*ID=(.*) $cmd_task $first_param\.*|\1|" | head -1 | awk -F " " '{print $1}') [[ $id ]] && update_cron "\"$id\"" "0" "$$" "$log_path" . $file_task_before $cmd 2>&1 @@ -127,10 +127,11 @@ run_concurrent() { [[ "$show_log" == "true" ]] && cmd="" make_dir $log_dir - local id=$(cat $list_crontab_user | grep -E "$cmd_task $first_param" | perl -pe "s|.*ID=(.*) $cmd_task $first_param\.*|\1|" | head -1 | awk -F " " '{print $1}') local begin_time=$(date '+%Y-%m-%d %H:%M:%S') eval echo -e "\#\# 开始执行... $begin_time\\\n" $cmd eval cat $task_error_log_path $cmd + + local id=$(cat $list_crontab_user | grep -E "$cmd_task $first_param" | perl -pe "s|.*ID=(.*) $cmd_task $first_param\.*|\1|" | head -1 | awk -F " " '{print $1}') [[ $id ]] && update_cron "\"$id\"" "0" "$$" "$log_path" eval . $file_task_before $cmd 2>&1 @@ -167,11 +168,11 @@ run_else() { [[ "$show_log" == "true" ]] && cmd="" make_dir "$log_dir" - local id=$(cat $list_crontab_user | grep -E "$cmd_task $first_param" | perl -pe "s|.*ID=(.*) $cmd_task $first_param\.*|\1|" | head -1 | awk -F " " '{print $1}') local begin_time=$(date '+%Y-%m-%d %H:%M:%S') eval echo -e "\#\# 开始执行... $begin_time\\\n" $cmd eval cat $task_error_log_path $cmd + local id=$(cat $list_crontab_user | grep -E "$cmd_task $first_param" | perl -pe "s|.*ID=(.*) $cmd_task $first_param\.*|\1|" | head -1 | awk -F " " '{print $1}') [[ $id ]] && update_cron "\"$id\"" "0" "$$" "$log_path" eval . $file_task_before $cmd 2>&1