At 6:42 PM +0200 5/21/01, [EMAIL PROTECTED] wrote:
>*This message was transferred with a trial version of CommuniGate(tm) Pro*
>Hello again,
>
>in your reply to my question regarding a potential conflict between 
>MacOSX and cron, you said that "unless you've redirected STDOUT/ERR 
>for the cron job, any output is mailed to the user who owns the cron 
>job." Pardon my asking, but how do you redirect STDOUT/ERR for the 
>cron job? I know how to redirect to STDERR within a Perl or Java 
>script, but not within cron.

* * * * * /i/am/the/command/running/in/cron > /home/outputlog 2> /home/errorlog

(or, if you don't want any output) ...

  * * * * * /i/am/the/command > /dev/null 2>&1

and so on ...

>
>Furthermore, simply replacing perl -e '... by /usr/bin/perl -e... 
>seemed to solve the problem, although I am not yet quite sure what 
>caused it.

hmmm, I believe that when cron spawns a shell (which is what it does 
everytime it runs a command), it doesn't necessarily read your login 
files, so I suspect that the path variable used by that cron job did 
not contain "/usr/bin"; the error that cron tried to mail to you was 
probably something like: "perl: command not found".

it's always a good idea to use the full path in cron.

>
>Philippe de Rochambeau


-- 
sandor w. sklar                
unix systems administrator     
stanford university itss-css

Reply via email to