FreeBSD & MacOSX ship with the the periodic(8) utility, which is a neatly organized set of utilities to periodically run system functions like ZFS filesystem checks, security checks, checking for out of date ports, etc.

The problem is that periodic sends too many emails which contain too much superfluous information. This causes people to ignore the emails, and we miss many problems picked up by periodic(8). The Daily emails are sent once per day, the security emails are sent once per day, and the weekly & monthly emails are also sent periodically. These emails have a subject line like one of these:

Subject: $HOSTNAME daily run output
Subject: $HOSTNAME security run output
Subject: $HOSTNAME weekly run output
Subject: $HOSTNAME monthly run output

How can I reduce the amount of email sent from periodic(8)?

I'll post my own answer below, but I would like to see what others have done.

Note: I have a similar question regarding Linux, at Linux: logwatch(8) & cron.daily is too noisy. How can I control the noise level?


Place something like the following in /etc/periodic.conf .

The following configuration will reduce the noise in the emails. If these messages are blank, then periodic(8) will not send an email. In addition, the security emails will be included with the daily emails, which also reduces noise.

# /etc/periodic.conf overrides the defaults in /etc/defaults/periodic.conf
# This file can be overriden by /etc/periodic.conf.local

# *_show_success, *_show_info & *_show_badconfig are disabled
# per recomendation of periodic(8) and "Absolute FreeBSD" p. 310-311
# and "Essential system administration, 3rd Ed." p. 98

# *_show_badconfig="NO" will suppress messages for tools which are not installed on this system (e.g. ZFS on a system without ZFS). 




# Include security jobs with daily email. No need to send second email.

# Don't need to know about denied packets every day

### Now, enable services which you DO want to be aware of    
# Check host for old ports

# Perform ZFS filesystem checks

The above example will get you 90% there. However, there is one additional problem which cannot be resolved using the standard FreeBSD config (as of 20110601). The script at /etc/periodic/daily/450.status-security will still print the following pointless message:

Security check:

-- End of daily output -- 

The fix is to apply the patch found in http://www.freebsd.org/cgi/query-pr.cgi?pr=138692 . This patch will modify the return codes for 450.status-security, so that extra messages won't be printed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.