<?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 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/36663#M16456</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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are examples I've seen where there is no &amp;lt;file&amp;gt; tag.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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/" target="_self"&gt;Cloudera here&lt;/A&gt;, repeats the shell script in file tag:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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" target="_self"&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;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;&amp;nbsp;&lt;/P&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;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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).&lt;/P&gt;&lt;P&gt;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>Fri, 16 Sep 2022 10:00:20 GMT</pubDate>
    <dc:creator>jdb</dc:creator>
    <dc:date>2022-09-16T10:00:20Z</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/36663#M16456</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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are examples I've seen where there is no &amp;lt;file&amp;gt; tag.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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/" target="_self"&gt;Cloudera here&lt;/A&gt;, repeats the shell script in file tag:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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" target="_self"&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;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;&amp;nbsp;&lt;/P&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;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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).&lt;/P&gt;&lt;P&gt;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>Fri, 16 Sep 2022 10:00:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Oozie-shell-action-exec-and-file-tags/m-p/36663#M16456</guid>
      <dc:creator>jdb</dc:creator>
      <dc:date>2022-09-16T10:00:20Z</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/38076#M16457</link>
      <description>Lets say you want to execute "script.sh"&lt;BR /&gt;&lt;BR /&gt;1. If you have script.sh inside your WF/lib/ path on HDFS, you just need &amp;lt;exec&amp;gt;script.sh&amp;lt;/exec&amp;gt;&lt;BR /&gt;&lt;BR /&gt;2. If you have script.sh on an arbitrary path on HDFS, you need:&lt;BR /&gt;&lt;BR /&gt;&amp;lt;exec&amp;gt;script.sh&amp;lt;/exec&amp;gt;&lt;BR /&gt;&amp;lt;file&amp;gt;/path/to/script.sh#script.sh&amp;lt;/file&amp;gt;&lt;BR /&gt;&lt;BR /&gt;3. Use of the below form with (1) is redundant, but the subsequent form is when you want to invoke it as a different name:&lt;BR /&gt;&lt;BR /&gt;&amp;lt;exec&amp;gt;script.sh&amp;lt;/exec&amp;gt;&lt;BR /&gt;&amp;lt;file&amp;gt;script.sh#script.sh&amp;lt;/file&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;exec&amp;gt;linked-script-name.sh&amp;lt;/exec&amp;gt;&lt;BR /&gt;&amp;lt;file&amp;gt;original-script-name.sh#linked-script-name.sh&amp;lt;/file&amp;gt;</description>
      <pubDate>Mon, 29 Feb 2016 06:55:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Oozie-shell-action-exec-and-file-tags/m-p/38076#M16457</guid>
      <dc:creator>Harsh J</dc:creator>
      <dc:date>2016-02-29T06:55:46Z</dc:date>
    </item>
  </channel>
</rss>

