Periodic emails send to syslog when there is an error

We have a few FreeBSD systems that send the standard periodic emails daily, weekly, etc. The configuration is currently the default

Code:
daily_output="root"                                     # user or /file
daily_show_success="YES"                                # scripts returning 0
daily_show_info="YES"                                   # scripts returning 1
daily_show_badconfig="NO"                               # scripts returning 2

I know I can send the output to a log if I change daily_output to "/var/log/daily.log" as explained in the man page. I also know I can disable the script based on the return code

But is there a way to setup periodic.conf to do the following:

  1. If the daily|weekly|monthly script returns 0, send the output to a log file
  2. If the script returns 1 or 2, send the output to the same log file as above, but also email root the results?
Thanks in advance.
 
Back
Top