HomeFreeBSD

MFC r352668: cron: log suppression and mail suppression for successful runs

Description

MFC r352668: cron: log suppression and mail suppression for successful runs

This commit adds two new extensions to crontab, ported from OpenBSD:

  • -n: suppress mail on succesful run
  • -q: suppress logging of command execution

The -q option appears decades old, but -n is relatively new. The
original proposal by Job Snijder can be found here [1], and gives very
convincing reasons for inclusion in base.

This patch is a nearly identical port of OpenBSD cron for -q and -n
features. It is written to follow existing conventions and style of the
existing codebase.

Example usage:

  1. should only send email, but won't show up in log
  2. * * * * -q date
  1. should not send email
  2. * * * * -n date
  1. should not send email or log
  2. * * * * -n -q date
  1. should send email because of ping failure
  2. * * * * -n -q ping -c 1 5.5.5.5

[1]: https://marc.info/?l=openbsd-tech&m=152874866117948&w=2

PR: 237538
Relnotes: yes

Details

Provenance
kevansAuthored on
Parents
rS353133: Do a commit for the output file when flushing for Copy.
Branches
Unknown
Tags
Unknown