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

Highlighted

oozie shell action

Contributor

Hi folks, what is difference between these two elements in shell action.In both cases we are mentioning script.sh

source url:-https://github.com/dbist/oozie/blob/master/apps/sqoopshell/workflow.xml

<exec>script.sh</exec>
<file>scripts/script.sh</file>

10113-2016-12-06-20-17-00-oozie-workflowxml-at-master-db.jpg

1 REPLY 1

Re: oozie shell action

Super Guru

@vamsi valiveti same question was answered here

https://community.hortonworks.com/questions/11912/oozie-shell-action-exec-and-file-tags.html

by @Benjamin Leonhardi

OK the exec tag executes a shell script in the local working directory of oozie.
For example /hadoop/yarn/.../oozietmp/myscript.sh
You have no idea before which directory this is or on which server it is located. It is in some yarn tmp dir.
The file tag is there to put something into this temp dir. And you can rename the file as well using the # syntax.
So if your shell script is in HDFS in hdfs://tmp/myfolder/myNewScript.sh
But you do not want to change the exec tag for some reason.
You can do
<file>/tmp/myfolder/myNewScript.sh#myscript.sh</file>
And oozie will take the file from HDFS put it into the tmp folder before execution and rename it.
You can use the file tag to upload any kind of files ( like jars or other dependencies )
As far as I can see the ${EXEC} is just a variable they set somewhere with no specific meaning.
Oh last but not least, if you want to avoid the file tag you can also simply put these files into a lib folder in the workflow folder. Oozie will upload all of these files per default.
Don't have an account?
Coming from Hortonworks? Activate your account here