From 42c64c82d759610fda7b0357845dc4e4f95c36c4 Mon Sep 17 00:00:00 2001 From: whyour Date: Sun, 16 Oct 2022 21:59:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20ql=20=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shell/update.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/shell/update.sh b/shell/update.sh index 0c359000..5291b34c 100755 --- a/shell/update.sh +++ b/shell/update.sh @@ -433,13 +433,14 @@ main() { local p6=$6 local p7=$7 local log_dir="${p1}" - make_dir "$dir_log/$log_path" + make_dir "$dir_log/$log_dir" local log_time=$(date "+%Y-%m-%d-%H-%M-%S") local log_path="${log_dir}/${log_time}.log" + local file_path="$dir_log/$log_path" - cmd=">> $dir_log/$log_path 2>&1" + cmd=">> $file_path 2>&1" [[ "$show_log" == "true" ]] && cmd="" - [[ -f $task_error_log_path ]] && cat $task_error_log_path $cmd + [[ -f $task_error_log_path ]] && eval cat $task_error_log_path $cmd if [[ "$show_log" == "true" ]] && [[ $ID ]]; then eval echo -e "请移除 -l 参数" $cmd @@ -501,8 +502,8 @@ main() { ;; esac - if [[ -f $log_path ]]; then - cat $log_path + if [[ -f $file_path ]]; then + cat $file_path local end_timestamp=$(date "+%s") local diff_time=$(($end_timestamp - $begin_timestamp)) [[ $ID ]] && update_cron "\"$ID\"" "1" "" "$log_path" "$begin_timestamp" "$diff_time"