From d0dd97631e3a24130b1ce8d9c7af98a7a77464f3 Mon Sep 17 00:00:00 2001 From: whyour Date: Wed, 3 May 2023 01:27:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20task=20=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=20ID=20=E6=9F=A5=E8=AF=A2=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shell/task.sh | 2 +- shell/update.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/shell/task.sh b/shell/task.sh index 57dfcf1d..a96627c2 100755 --- a/shell/task.sh +++ b/shell/task.sh @@ -39,7 +39,7 @@ handle_log_path() { fi if [[ -z $ID ]]; then - ID=$(cat $list_crontab_user | grep -E "$cmd_task.* $filename" | perl -pe "s|.*ID=(.*) $cmd_task.* $filename\.*|\1|" | head -1 | awk -F " " '{print $1}') + ID=$(cat $list_crontab_user | grep -E "$cmd_task.* $file_param" | perl -pe "s|.*ID=(.*) $cmd_task.* $file_param\.*|\1|" | head -1 | awk -F " " '{print $1}') fi local suffix="" if [[ ! -z $ID ]]; then diff --git a/shell/update.sh b/shell/update.sh index e2f97bca..730e2706 100755 --- a/shell/update.sh +++ b/shell/update.sh @@ -46,7 +46,7 @@ del_cron() { local ids="" echo -e "开始尝试自动删除失效的定时任务...\n" for cron in $(cat $list_drop); do - local id=$(cat $list_crontab_user | grep -E "$cmd_task $cron" | perl -pe "s|.*ID=(.*) $cmd_task $cron\.*|\1|" | head -1 | head -1 | awk -F " " '{print $1}') + local id=$(cat $list_crontab_user | grep -E "$cmd_task.* $cron" | perl -pe "s|.*ID=(.*) $cmd_task.* $cron\.*|\1|" | head -1 | awk -F " " '{print $1}') if [[ $ids ]]; then ids="$ids,\"$id\"" else