
04-25-2003
|
 |
Have a day :|
|
|
Join Date: Aug 2002
Location: Cleveland, OH
Posts: 804
|
|
Here's a blurb from unixgeeks.org (note the bold):
Quote:
Output from cron
As I've said before, the output from cron gets mailed to the owner of the process, or the person specified in the MAILTO variable, but what if you don't want that? If you want to mail the output to someone else, you can just pipe the output to the command mail.
e.g.
cmd | mail -s "Subject of mail" user
If you wish to mail the output to someone not located on the machine, in the above example, substitute user for the email address of the person who wishes to receive the output.
If you have a command that is run often, and you don't want to be emailed the output every time, you can redirect the output to a log file (or /dev/null, if you really don't want the output).
e.g.
cmd >> log.file
Notice we're using two > signs so that the output appends the log file and doesn't clobber previous output. The above example only redirects the standard output, not the standard error, if you want all output stored in the log file, this should do the trick:
cmd >> logfile 2>&1
|
|
|
Google UNIX.COM
|