Files
smeserver-mailstats/root/usr/bin/runallmailstats.sh
Brian Read 1b757b1336 * Thu Sep 04 2025 Brian Read <brianr@koozali.org> 11.1-6.sme
- Add favicon to mailstats table, summary and detailed pages [SME: 13121]
- Bring DB config reading for mailstats itself inline with php summary and detailed logs - using /etc/mailstats/db.php [SME: 13121]
- Remove DB config fields from the SM2 config panel {sme: 13121]
- Arrange for password to be generated and mailstats user to be set with limited permissions [SME: 13121]
2025-09-08 15:24:18 +01:00

16 lines
503 B
Bash
Executable File

#!/bin/bash
# Extract the earliest date from the journalctl header for qpsmtpd service
earliest_date=$(journalctl -u qpsmtpd | head -n 1 | sed -n 's/.*Logs begin at [A-Za-z]* \([0-9-]*\).*/\1/p')
# Get yesterday's date
yesterday=$(date -d 'yesterday' +%F)
current_date="$earliest_date"
# Loop from earliest date to yesterday
while [[ "$current_date" < "$yesterday" || "$current_date" == "$yesterday" ]]; do
runmailstats.sh "$current_date"
current_date=$(date -I -d "$current_date + 1 day")
done