Skip to content

Commit

Permalink
fix after hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
axelhahn committed Dec 20, 2023
1 parent 550f88c commit d89e76a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cronwrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand All @@ -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
# ------------------------------------------------------------
Expand Down

0 comments on commit d89e76a

Please sign in to comment.