Is the 2>&1 necessary?
In my cron table i put a line like that
0 2 * * * /usr/local/bin/myscript.pl > /var/log/mylog.log I forgot to put the 2>&1 at the end of the line above and it worked as i expected, no email came to my inbox, but in the /var/log/mylog.log Now, i am wondering about the necessity of 2>&1 |
2>&1 Redirects any error messages (or anything sent to standard error) to standard output. Without it, error messages will be logged to the cron process, which I think puts them in syslog (ending up in /var/log/messages) rather than emailing them to you (which is what happens with standard output).
|
All times are GMT -5. The time now is 11:21 AM. |