diff options
author | Dennis Eriksen <d@ennis.no> | 2019-03-01 07:43:01 +0100 |
---|---|---|
committer | Dennis Eriksen <d@ennis.no> | 2019-03-01 07:43:01 +0100 |
commit | 25d814c0b3c5088fd2003ea676e0d6674466e391 (patch) | |
tree | 7ebd5d88822a9cf621ea7c0c6ac22d4f852f8fac | |
parent | moving wildcard for globbing out of quotes (diff) | |
download | eximstats-cron-25d814c0b3c5088fd2003ea676e0d6674466e391.tar.gz |
do not run this months total on the first - there is no data to run it on yet
-rwxr-xr-x | eximstats-cron | 12 |
1 files 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. |