Skip to content

Instantly share code, notes, and snippets.

@bmatthewshea
Last active August 7, 2023 14:28
Show Gist options
  • Save bmatthewshea/20a8f7f4f71874722d7e7de7ddb605d0 to your computer and use it in GitHub Desktop.
Save bmatthewshea/20a8f7f4f71874722d7e7de7ddb605d0 to your computer and use it in GitHub Desktop.
pflogsumm cron.daily script
#!/bin/sh
# Save this script as:
# `/etc/cron.daily/pflogsumm`
# It should be owned by root.
# Then set permissions: `sudo chmod 755 /etc/cron.daily/pflogsumm`
# the script will also run directly if you wish to test it.
# Brady Shea 31Jul2023
test -x /usr/sbin/pflogsumm || exit 0
/usr/sbin/pflogsumm -d yesterday --problems_first /var/log/mail.lo* \
| mail -a 'From: Daily Postfix Report <no_reply@mydomain.com>' -s "MYDOMAIN.COM Email Server Activity Report" postmaster@mydomain.com
@bmatthewshea
Copy link
Author

Note: The file name has ".sh" on it simply to allow highlighting correctly. Read the comments at top of script as to how to save it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment