if you are using the sh or bash, the variable $? holds the exit status of
the last command to execute.

hadoop jar streaming.jar ...
if [ $? -ne 0 ]; then
    echo "My job failed" 2>&1
    exit 1
fi

Caution $? is the very last command to execute's exit status. It is easy to
run another command before testing and then test the wrong command's exit
status



On Sat, May 2, 2009 at 11:56 AM, Mayuran Yogarajah <
mayuran.yogara...@casalemedia.com> wrote:

> Billy Pearson wrote:
>
>> I done this with and array of commands for the jobs in a php script
>> checking
>> the return of the job to tell if it failed or not.
>>
>> Billy
>>
>>
>>
> I have this same issue.. How do you check if a job failed or not? You
> mentioned checking
> the return code? How are you doing that ?
>
> thanks
>
>  "Dan Milstein" <dmilst...@hubteam.com> wrote in
>> message news:58d66a11-b59c-49f8-b72f-7507482c3...@hubteam.com...
>>
>>
>>> If I've got a sequence of streaming jobs, each of which depends on the
>>> output of the previous one, is there a good way to launch that  sequence?
>>> Meaning, I want step B to only start once step A has  finished.
>>>
>>> From within Java JobClient code, I can do submitJob/runJob, but is  there
>>> any sort of clean way to do this for a sequence of streaming jobs?
>>>
>>> Thanks,
>>> -Dan Milstein
>>>
>>>
>>>
>>
>>
>>
>>
>
>


-- 
Alpha Chapters of my book on Hadoop are available
http://www.apress.com/book/view/9781430219422

Reply via email to