From 25d814c0b3c5088fd2003ea676e0d6674466e391 Mon Sep 17 00:00:00 2001 From: Dennis Eriksen Date: Fri, 1 Mar 2019 07:43:01 +0100 Subject: do not run this months total on the first - there is no data to run it on yet --- eximstats-cron | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/eximstats-cron b/eximstats-cron index 496c9f3..854a798 100755 --- a/eximstats-cron +++ b/eximstats-cron @@ -48,11 +48,13 @@ stats_for_last_n_days 7 stats_for_last_n_days 30 -# update this months total -folder="${STATDIR}/"$(date "+%Y/%m/total") -[ -d "${folder}" ] && rm -f "${folder}"/* || mkdir "${folder}" -cd "${folder}" -eximstats -charts -merge -html="index.html" ../*.html +# update this months total, unless it is the first of the month +if [ $(date '+%d') != 01 ]; then + folder="${STATDIR}/"$(date "+%Y/%m/total") + [ -d "${folder}" ] && rm -f "${folder}"/* || mkdir "${folder}" + cd "${folder}" + eximstats -charts -merge -html="index.html" ../*.html +fi # If it's the first of the month, do monthly total for last month. # Also, we update the total for the year. -- cgit v1.2.3