Sending all cron output to syslog by default

Hi everyone,

I'm wondering if there's a way to send all cron output to syslog by default. I know, of course, you can can use shell redirection into a file, or even pipe a specific command's output to logger(1), and that'll get it to the appropriate log file according to syslog's configuration… but I'm wondering if there's anything that can be done at the cron configuration level (or even invocation via some --flag) to, by default, even if I don't employ any of those techniques at the individual job level, still send all cron output to syslog.

Thanks!
 
set MAILTO to an account aliased to a script
so in cronfile
MAILTO=logx
in aliases
logx:"|/usr/local/somepath/somescript" (or directly to logger)

pipe aliases work with sendmail, don't know about the wanna be MTAs
 
set MAILTO to an account aliased to a script
so in cronfile
MAILTO=logx
in aliases
logx:"|/usr/local/somepath/somescript"

pipe aliases work with sendmail, don't know about the wanna be MTAs

First off:
the wanna be MTAs
🤣🤣🤣

That having been said, when you say "in aliases", you mean aliases(5), i.e. sendmail's /etc/mail/aliases?

And, if that's correct, you're saying there's no simpler way, like invoking cron with some collection of --flags, or setting some environment variables?

Thanks!
 
yes, /etc/mail/aliases
i don't know about flags but you can also override SHELL and replace it with a script that does things
Configuring SHELL to point to a script that does stuff and then sends output to logger(8), now that's an interesting idea!

I've been reading the cron(8) man page and I haven't found anything that might help me achieve what I want, so that's definitely looking like the best and simplest alternative.

Many thanks!
 
Back
Top