aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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.