From 5f2e363f8fc907a93242997efd90d3827f8b345b Mon Sep 17 00:00:00 2001 From: "Hahn Axel (hahn)" <axel.hahn@iml.unibe.ch> Date: Mon, 28 Feb 2022 15:12:01 +0100 Subject: [PATCH] fix output of error counter --- check_cronstatus | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/check_cronstatus b/check_cronstatus index 88b51c7..e2f579f 100755 --- a/check_cronstatus +++ b/check_cronstatus @@ -21,6 +21,7 @@ # 2019-04-30 v1.2 ah,ds show scriptlabel of failed jobs in 1st line # 2020-02-28 v1.3 ah,ds ouput with separated error jobs and OK jobs # 2020-03-05 v1.4 <axel.hahn@iml.unibe.ch> switch to ph.* helper functions +# 2022-02-28 v1.5 <axel.hahn@iml.unibe.ch> fix output of error counter # ====================================================================== @@ -143,7 +144,7 @@ do if [ $iErr -gt 0 ]; then echo "${sPre}CHECK FAILED" iErrJobs=$iErrJobs+1 - echo $iErrJobs > $errfile + echo "$logfile" > $errfile getLogValue SCRIPTLABEL >> $failfile fi )>>$sTmpOutfile @@ -156,7 +157,7 @@ done # ---------------------------------------------------------------------- if [ -f $errfile ]; then - iErrJobs=`cat $errfile` + iErrJobs=$(wc -l $errfile) echo "ERROR: $iErrJobs of $iJobs jobs [`cat $failfile | sed ':a;N;$!ba;s/\n/, /g'`] have a problem" echo echo "********** Jobs with problems:" -- GitLab