Closed JohnnyJayJay closed 1 year ago
Looks good except one thing. I'd call the variable simply NO_MAIL_OUTPUT.
Looks good except one thing. I'd call the variable simply NO_MAIL_OUTPUT.
Done.
Just to be clear, since some of the annotations refer to code that was not written by me: do you want me to reformat the whole anacron project for consistency? I find the style questionable, but intentionally decided against touching it and left it as-is. This concerns indentation, curly braces and new lines.
Just to be clear, since some of the annotations refer to code that was not written by me: do you want me to reformat the whole anacron project for consistency? I find the style questionable, but intentionally decided against touching it and left it as-is. This concerns indentation, curly braces and new lines.
No, do not reformat please. Just change the lines I've commented about.
Merged. Thank you for your contribution.
This PR adds support for a new environment variable
INHERIT_OUTPUTS
which, when set, indicates that the outputs (stdout and stderr) of a job should not be sent by mail and instead just be written to stdout/stderr as usual. The value of this feature is that it allows for a more uniform logging approach without a mail server set up.For example, on my system,
anacron
is run bycronie
every hour (as is the default). The outputs of cronie and anacron are logged injournalctl
. It would be nice to have the logs of my anacron jobs there as well, which can be achieved by leaving stdout and stderr of the job processes as-is.This PR's motivation is similar to that of #135 but completely ignores the mail functionality.