What are options available to get cron's results and how to set them up? What are options available to get cron's results and how to set them up? unix unix

What are options available to get cron's results and how to set them up?


To email the output to a different email address just add the line

MAILTO="user@example.com"

To the crontab before the command


You could chuck file redirection onto either the command shown or the actual command in the crontab for both stdout and stderr - like command > /tmp/log.txt 2>&1 .

If you want several users to receive this log, you could insert a MAILTO=nameofmailinglist at the top of you cron file.


The cron line is just like any other unix command line so you can redirect output to another program. Ie.

* * * * * /path/my/command > /my/email/script 2&>1