2023-07-09 12:18:48 +02:00
|
|
|
#!/bin/bash
|
2024-06-11 17:32:06 +02:00
|
|
|
#exec 1> >(logger -t $(basename $0)) 2>&1
|
2024-12-18 06:36:42 +01:00
|
|
|
perl /usr/bin/mailstats.pl /var/log/qpsmtpd/*.log /var/log/sqpsmtpd/*.log /var/log/uqpsmtpd/*.log
|
2024-06-06 15:56:19 +02:00
|
|
|
# and run new python one - start by copying and decoding log files
|
2024-12-18 06:36:42 +01:00
|
|
|
yesterday_date=$(date -d "yesterday" +'%b %d')
|
|
|
|
echo $yesterday_date
|
2024-06-06 15:56:19 +02:00
|
|
|
cd /var/log/qpsmtpd
|
2024-12-18 06:36:42 +01:00
|
|
|
cat *.log >/opt/mailstats/logs/current1 2>/dev/null
|
2024-06-06 15:56:19 +02:00
|
|
|
cd /var/log/sqpsmtpd
|
2024-12-18 06:36:42 +01:00
|
|
|
cat *.log >/opt/mailstats/logs/current2 2>/dev/null
|
2024-12-17 19:40:26 +01:00
|
|
|
cd /var/log/uqpsmtpd
|
2024-12-18 06:36:42 +01:00
|
|
|
cat *.log >/opt/mailstats/logs/current3 2>/dev/null
|
2024-06-06 15:56:19 +02:00
|
|
|
cd /opt/mailstats/logs
|
2024-12-18 06:36:42 +01:00
|
|
|
cat current1 current2 current3 2>/dev/null | grep "$yesterday_date" > current.log
|
2024-06-06 15:56:19 +02:00
|
|
|
ls -l
|
|
|
|
python3 /usr/bin/mailstats.py
|
|
|
|
echo "Done"
|