From d89e76ab1377d98a41c71c3a6d5eab2667e24e7b Mon Sep 17 00:00:00 2001 From: Axel Hahn Date: Wed, 20 Dec 2023 23:37:21 +0100 Subject: [PATCH] fix after hooks --- cronwrapper.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cronwrapper.sh b/cronwrapper.sh index 2515774..15a74b4 100755 --- a/cronwrapper.sh +++ b/cronwrapper.sh @@ -151,7 +151,7 @@ function runHooks(){ do if [ -x "$_hookdir/$hookscript" ]; then echo "----- HOOK START: $_hookdir/$hookscript" - $_hookdir/$hookscript + "$_hookdir/$hookscript" echo "----- HOOK END : $_hookdir/$hookscript" echo else @@ -334,8 +334,6 @@ w SCRIPTEXECTIME=$iExectime s w SCRIPTRC=$rc w "REM $line1" -sed -e 's/<[^>]*>//g' "${CW_LOGFILE}" | sed "s#^#SCRIPTOUT=#g" >>"$CW_OUTFILE" -w "REM $line1" # write a log for execution of a cronjob echo "job=${CW_LABELSTR}:host=$CW_MYHOST:start=$CW_TIMER_START:end=$CW_TIMER_END:exectime=$iExectime:ttl=${TTL}:rc=$rc" >>"$CW_JOBLOG" @@ -344,6 +342,9 @@ find $CW_LOGDIR -name "${CW_JOBBLOGBASE}*" -type f -mtime +4 -exec rm -f {} \; runHooks "after" $rc >>"${CW_LOGFILE}" 2>&1 +sed -e 's/<[^>]*>//g' "${CW_LOGFILE}" | sed "s#^#SCRIPTOUT=#g" >>"$CW_OUTFILE" +w "REM $line1" + # ------------------------------------------------------------ # CLEANUP AND END # ------------------------------------------------------------