Cron job unified logging

No, it's likely that they will overwrite each other.

As a simple method add

[email protected]

at the top of the crontab, then cron will email any output to you.

A more complex method may involve setting up cronolog listening on a FIFO then sending the output of those scripts to the fifo. This would take some care and handling, if the FIFO goes down then your cron jobs will block writing to it.

To be honest, I prefer cron jobs that output nothing unless there is a problem, in which case MAILTO lets me know.


even simpler method is to pipe all output into 'logger' tool and log to syslog, i.e.

* * * * * cronjob1.sh 2>&1 | logger -t cronjob1
* * * * * cronjob2.sh 2>&1 | logger -t cronjob2

then look in /var/log/messages

the disadvantage is that this is machine wide and you have to be root to be able to see the log, although it is possible to set up separate syslog files with user accessible permissions.