<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Oozie shell action: exec and file tags in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Oozie-shell-action-exec-and-file-tags/m-p/113309#M16506</link>
    <description>&lt;P&gt;OK the exec tag executes a shell script in the local working directory of oozie.&lt;/P&gt;&lt;P&gt;For example /hadoop/yarn/.../oozietmp/myscript.sh&lt;/P&gt;&lt;P&gt;You have no idea before which directory this is or on which server it is located. It is in some yarn tmp dir. &lt;/P&gt;&lt;P&gt;The file tag is there to put something into this temp dir. And you can rename the file as well using the # syntax.&lt;/P&gt;&lt;P&gt;So if your shell script is in HDFS in hdfs://tmp/myfolder/myNewScript.sh&lt;/P&gt;&lt;P&gt;But you do not want to change the exec tag for some reason.&lt;/P&gt;&lt;P&gt;You can do&lt;/P&gt;&lt;P&gt;&amp;lt;file&amp;gt;/tmp/myfolder/myNewScript.sh#myscript.sh&amp;lt;/file&amp;gt;&lt;/P&gt;&lt;P&gt;And oozie will take the file from HDFS put it into the tmp folder before execution and rename it. &lt;/P&gt;&lt;P&gt;You can use the file tag to upload any kind of files ( like jars or other dependencies ) &lt;/P&gt;&lt;P&gt;As far as I can see the ${EXEC} is just a variable they set somewhere with no specific meaning.&lt;/P&gt;&lt;P&gt;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. &lt;/P&gt;</description>
    <pubDate>Wed, 27 Jan 2016 17:55:31 GMT</pubDate>
    <dc:creator>bleonhardi</dc:creator>
    <dc:date>2016-01-27T17:55:31Z</dc:date>
    <item>
      <title>Oozie shell action: exec and file tags</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Oozie-shell-action-exec-and-file-tags/m-p/113308#M16505</link>
      <description>&lt;P&gt;I'm a newbie in Oozie and I've read some Oozie shell action examples but this got me confused about certain things.
There are examples I've seen where there is no &amp;lt;file&amp;gt; tag. &lt;/P&gt;&lt;P&gt;Some example, like in &lt;A href="http://blog.cloudera.com/blog/2013/03/how-to-use-oozie-shell-and-java-actions/"&gt;Cloudera here&lt;/A&gt;, repeats the shell script in file tag:&lt;/P&gt;&lt;PRE&gt;&amp;lt;shell xmlns="uri:oozie:shell-action:0.2"&amp;gt;
	&amp;lt;exec&amp;gt;check-hour.sh&amp;lt;/exec&amp;gt;
        &amp;lt;argument&amp;gt;${earthquakeMinThreshold}&amp;lt;/argument&amp;gt;
        &amp;lt;file&amp;gt;check-hour.sh&amp;lt;/file&amp;gt;
&amp;lt;/shell&amp;gt; &lt;/PRE&gt;&lt;P&gt;While in &lt;A href="https://oozie.apache.org/docs/4.1.0/DG_ShellActionExtension.html#Shell_Action"&gt;Oozie's website&lt;/A&gt;, writes the shell script (the reference ${EXEC} from job.properties, which points to script.sh file) twice, separated by #. &lt;/P&gt;&lt;PRE&gt;&amp;lt;shell xmlns="uri:oozie:shell-action:0.1"&amp;gt;
        ...
        &amp;lt;exec&amp;gt;${EXEC}&amp;lt;/exec&amp;gt;
        &amp;lt;argument&amp;gt;A&amp;lt;/argument&amp;gt;
        &amp;lt;argument&amp;gt;B&amp;lt;/argument&amp;gt;
        &amp;lt;file&amp;gt;${EXEC}#${EXEC}&amp;lt;/file&amp;gt;
&amp;lt;/shell&amp;gt; &lt;/PRE&gt;&lt;P&gt;There are also examples I've seen where the path (HDFS or local?) is prepended  before the `script.sh#script.sh` within the &amp;lt;file&amp;gt; tag. &lt;/P&gt;&lt;PRE&gt;&amp;lt;shell xmlns="uri:oozie:shell-action:0.1"&amp;gt;
        ...
        &amp;lt;exec&amp;gt;script.sh&amp;lt;/exec&amp;gt;
        &amp;lt;argument&amp;gt;A&amp;lt;/argument&amp;gt;
        &amp;lt;argument&amp;gt;B&amp;lt;/argument&amp;gt;
        &amp;lt;file&amp;gt;/path/script.sh#script.sh&amp;lt;/file&amp;gt;
&amp;lt;/shell&amp;gt; &lt;/PRE&gt;&lt;P&gt;As I understand, any shell script file can be included in the workflow HDFS path (same path where workflow.xml resides).
Can someone explain the differences in these examples and how `&amp;lt;exec&amp;gt;`, `&amp;lt;file&amp;gt;`, `script.sh#script.sh`, and the `/path/script.sh#script.sh` are used?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2016 15:34:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Oozie-shell-action-exec-and-file-tags/m-p/113308#M16505</guid>
      <dc:creator>menorah84</dc:creator>
      <dc:date>2016-01-27T15:34:46Z</dc:date>
    </item>
    <item>
      <title>Re: Oozie shell action: exec and file tags</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Oozie-shell-action-exec-and-file-tags/m-p/113309#M16506</link>
      <description>&lt;P&gt;OK the exec tag executes a shell script in the local working directory of oozie.&lt;/P&gt;&lt;P&gt;For example /hadoop/yarn/.../oozietmp/myscript.sh&lt;/P&gt;&lt;P&gt;You have no idea before which directory this is or on which server it is located. It is in some yarn tmp dir. &lt;/P&gt;&lt;P&gt;The file tag is there to put something into this temp dir. And you can rename the file as well using the # syntax.&lt;/P&gt;&lt;P&gt;So if your shell script is in HDFS in hdfs://tmp/myfolder/myNewScript.sh&lt;/P&gt;&lt;P&gt;But you do not want to change the exec tag for some reason.&lt;/P&gt;&lt;P&gt;You can do&lt;/P&gt;&lt;P&gt;&amp;lt;file&amp;gt;/tmp/myfolder/myNewScript.sh#myscript.sh&amp;lt;/file&amp;gt;&lt;/P&gt;&lt;P&gt;And oozie will take the file from HDFS put it into the tmp folder before execution and rename it. &lt;/P&gt;&lt;P&gt;You can use the file tag to upload any kind of files ( like jars or other dependencies ) &lt;/P&gt;&lt;P&gt;As far as I can see the ${EXEC} is just a variable they set somewhere with no specific meaning.&lt;/P&gt;&lt;P&gt;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. &lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2016 17:55:31 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Oozie-shell-action-exec-and-file-tags/m-p/113309#M16506</guid>
      <dc:creator>bleonhardi</dc:creator>
      <dc:date>2016-01-27T17:55:31Z</dc:date>
    </item>
  </channel>
</rss>

