From 8708b9c161fe7cca8cec49bfd2183d7e9168894c Mon Sep 17 00:00:00 2001 From: Madic- <3735459+Madic-@users.noreply.github.com> Date: Mon, 12 Nov 2018 11:40:39 +0100 Subject: [PATCH] Add pflogsumm cron example --- docs/u_e-postfix-pflogsumm.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/u_e-postfix-pflogsumm.md b/docs/u_e-postfix-pflogsumm.md index 647a76bdd..bac124b17 100644 --- a/docs/u_e-postfix-pflogsumm.md +++ b/docs/u_e-postfix-pflogsumm.md @@ -5,3 +5,12 @@ docker logs --since 24h $(docker ps -qf name=postfix-mailcow) | pflogsumm ``` The above log output is limited to the past 24 hours. + +It's also possible to create a daily pflogsumm report via cron. Create the file /etc/cron.d/pflogsumm with the following content: + +``` +SHELL=/bin/bash +59 23 * * * root docker logs --since 24h $(docker ps -qf name=postfix-mailcow) | /usr/sbin/pflogsumm -d today | mail -s "Postfix Report of $(date)" postmaster@example.net +``` + +Based on the last 24h postfix logs, this example sends every day at 23:59:00 a pflogsumm report to postmaster@example.net.