]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/commitdiff
sarg: Remove all previously created reports of "today".
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 26 Nov 2012 10:05:49 +0000 (11:05 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 26 Nov 2012 10:05:49 +0000 (11:05 +0100)
config/sarg/update-sarg-reports

index 84a7052bc6321565cf893aef8c05b98f8e000a61..9f2ab4c8cdf4550daa9d87164b37ffbb572f4463 100644 (file)
@@ -95,6 +95,13 @@ function compile_report() {
        local reports_path="${REPORTS_PATH}/${interval}"
        mkdir -p ${reports_path}
 
+       # Remove already existant data on today's reports.
+       case "${interval}" in
+               today)
+                       rm -rf ${reports_path}/*
+                       ;;
+       esac
+
        # Run SARG.
        get_logs ${max_logs} | sarg -f ${SARG_CONFIG} -l - -d ${date} -o ${reports_path}
 }