Streamline overnight commans to only pass yesterdays data

This commit is contained in:
Brian Read 2024-06-16 08:40:56 +01:00
parent 1917053811
commit 5e77fd4c82

View File

@ -2,13 +2,13 @@
#exec 1> >(logger -t $(basename $0)) 2>&1
perl /usr/bin/mailstats.pl /var/log/qpsmtpd/\@* /var/log/qpsmtpd/current /var/log/sqpsmtpd/\@* /var/log/sqpsmtpd/current
# and run new python one - start by copying and decoding log files
yesterday_date=$(date -d "yesterday" +'%Y-%m-%d')
cd /var/log/qpsmtpd
cat \@* current >/opt/mailstats/logs/current1 2>/dev/null
cd /var/log/sqpsmtpd
cat \@* current >/opt/mailstats/logs/current2 2>/dev/null
cd /opt/mailstats/logs
cat current1 current2 2>/dev/null | /usr/local/bin/tai64nlocal | grep "$yesterday_date" > current.log
ls -l
cat current1 current2 2>/dev/null | tai64nlocal > current.log
python3 /usr/bin/mailstats.py
echo "Done"