Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

oozie shell action doesnt send email

oozie shell action doesnt send email

Contributor

I am running a shell script through oozie. A piece of my shell script has below code. I receive an email when I run this shell script through unix Command line but when I run this shell script through oozie Job it will succeed but I dont get any mail. How can I resolve this? Or is there any alternative way I can get email with attachment once string matches in unix filesystem?

if [ "$Var" = "Error" ] then echo "Data error" | mail -v -s "Data Error" -a error.csv -S smtp=smtp://mail-gateway -S from=localhost@gmail.com" Kevin@gmail.com exit

3 REPLIES 3

Re: oozie shell action doesnt send email

Rising Star

Do you receive email when you run the mail command manually on different worker nodes in your cluster (remember shell action will run on a randomly assigned worker node)?

Highlighted

Re: oozie shell action doesnt send email

Contributor

It works, When I manually run mail from worker and master nodes. When I runt the shell script from oozie. it doesnot work.

Re: oozie shell action doesnt send email

Cloudera Employee

I would suggest to use a Decision node and an Email action instead of sending the mail from a shell script.

If you prefer the shell, make sure you set every environment variable that's needed for the mail command to work.

Don't have an account?
Coming from Hortonworks? Activate your account here