aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDennis Eriksen <d@ennis.no>2019-03-01 07:43:01 +0100
committerDennis Eriksen <d@ennis.no>2019-03-01 07:43:01 +0100
commit25d814c0b3c5088fd2003ea676e0d6674466e391 (patch)
tree7ebd5d88822a9cf621ea7c0c6ac22d4f852f8fac
parentmoving wildcard for globbing out of quotes (diff)
downloadeximstats-cron-25d814c0b3c5088fd2003ea676e0d6674466e391.tar.gz
do not run this months total on the first - there is no data to run it on yet
-rwxr-xr-xeximstats-cron12
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.