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