cronie-crond / cronie

Cronie cron daemon project
Other
453 stars 77 forks source link

Feature request: -n option to check exit code #169

Closed fragglet closed 6 months ago

fragglet commented 6 months ago

All the major BSDs support a -n prefix before the command that only mails if the command fails. From the OpenBSD documentation:

     -n command
             No mail is sent after a successful run.  The execution output
             will only be mailed if the command exits with a non-zero exit
             code.  The -n option is an attempt to cure potentially copious
             volumes of mail coming from cron(8).

For some reason this doesn't seem to have made its way to Vixie Cron and its descendants, including cronie.

It seems like a common enough question on Stack Overflow, and people have all kinds of elaborate workarounds in the replies:

TO CLARIFY: the desired behavior here is:

NOT ALTERNATIVE SOLUTIONS:

t8m commented 6 months ago

This was already implemented by #121 and is present in 1.7.0 release.