<?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 How to remove folder and everything inside that folder in Apache Nifi? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-to-remove-folder-and-everything-inside-that-folder-in/m-p/186693#M148795</link>
    <description>&lt;P&gt;How to remove folder and everything inside that folder in Apache Nifi?&lt;/P&gt;</description>
    <pubDate>Fri, 11 May 2018 14:52:57 GMT</pubDate>
    <dc:creator>adamchui</dc:creator>
    <dc:date>2018-05-11T14:52:57Z</dc:date>
    <item>
      <title>How to remove folder and everything inside that folder in Apache Nifi?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-remove-folder-and-everything-inside-that-folder-in/m-p/186693#M148795</link>
      <description>&lt;P&gt;How to remove folder and everything inside that folder in Apache Nifi?&lt;/P&gt;</description>
      <pubDate>Fri, 11 May 2018 14:52:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-remove-folder-and-everything-inside-that-folder-in/m-p/186693#M148795</guid>
      <dc:creator>adamchui</dc:creator>
      <dc:date>2018-05-11T14:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove folder and everything inside that folder in Apache Nifi?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-remove-folder-and-everything-inside-that-folder-in/m-p/186694#M148796</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/17015/bearchui.html" nodeid="17015" target="_blank"&gt;@adam chui&lt;/A&gt;
&lt;/P&gt;&lt;P&gt;By using Execute Stream Command processor we can pass the argument as the directory path that need to delete and by using &lt;STRONG&gt;rm -rf&lt;/STRONG&gt; command we can delete folder and everything inside the folder.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Example:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I'm having &lt;STRONG&gt;del_nifi&lt;/STRONG&gt; directory in &lt;STRONG&gt;tmp&lt;/STRONG&gt; directory and nifi having access to delete this folder&lt;/P&gt;&lt;PRE&gt;[bash tmp]$ ll&lt;BR /&gt;drwxr-xr-x 2 nifi       hadoop        29 May 11 09:04 del_nifi&lt;BR /&gt;[bash tmp]$ cd del_nifi&lt;BR /&gt;[bash del_nifi]$ ll
-rw-r--r-- 1 nifi hadoop 20 May 11 09:04 6728259595979699&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Flow:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="73440-flow.png" style="width: 1698px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/18787i67A7F7A7132D345A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="73440-flow.png" alt="73440-flow.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;GenerateFlowFile Configs:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Added new property called &lt;STRONG&gt;directory &lt;/STRONG&gt;with &lt;STRONG&gt;/tmp/del_nifi &lt;/STRONG&gt;with the value.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;ExecuteStreamCommand Configs:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="73441-escommand.png" style="width: 1448px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/18788iA8409DAB09E7F5D2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="73441-escommand.png" alt="73441-escommand.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Command Arguments&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;-rf;${directory} //we are passing directory attribute and -rf as arguments to rm command&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;Command Path&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;rm&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Now ExecuteStreamCommand processor will delete the directory/subdirectories/files in the directory.&lt;BR /&gt;-&lt;/P&gt;&lt;P&gt;More info regarding rm command &lt;/P&gt;&lt;PRE&gt;[bash tmp]$ rm --help&lt;BR /&gt;-r, -R, --recursive   remove directories and their contents recursively&lt;BR /&gt;-f, --force           ignore nonexistent files and arguments, never prompt&lt;/PRE&gt;</description>
      <pubDate>Sun, 18 Aug 2019 08:10:14 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-remove-folder-and-everything-inside-that-folder-in/m-p/186694#M148796</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T08:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove folder and everything inside that folder in Apache Nifi?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-remove-folder-and-everything-inside-that-folder-in/m-p/186695#M148797</link>
      <description>&lt;P&gt;Thanks, it is a good answer, may I know how to run a command Execute Stream Command processor with pipeline "|" ? &lt;/P&gt;</description>
      <pubDate>Sat, 12 May 2018 17:08:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-remove-folder-and-everything-inside-that-folder-in/m-p/186695#M148797</guid>
      <dc:creator>adamchui</dc:creator>
      <dc:date>2018-05-12T17:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove folder and everything inside that folder in Apache Nifi?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-remove-folder-and-everything-inside-that-folder-in/m-p/186696#M148798</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/17015/bearchui.html" nodeid="17015"&gt;@adam chui&lt;/A&gt;
&lt;/P&gt;&lt;P&gt;We are not able execute commands in ExecuteStreamCommand processor like &lt;/P&gt;&lt;PRE&gt;[bash] cat &amp;lt;filename&amp;gt;|grep &amp;lt;search string&amp;gt;&lt;BR /&gt;(or) &lt;BR /&gt;[bash] ls |wc -l&lt;/PRE&gt;&lt;P&gt;But you can use QueryRecord processor and write the sql query(to filter or count..) then the query is going to be executed on the contents of the flowfile.&lt;/P&gt;&lt;P&gt;Take a look into &lt;A href="https://community.hortonworks.com/articles/121794/running-sql-on-flowfiles-using-queryrecord-process.html" target="_blank"&gt;this&lt;/A&gt; link for more details regarding Query Record processor.&lt;/P&gt;</description>
      <pubDate>Sat, 12 May 2018 20:10:40 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-remove-folder-and-everything-inside-that-folder-in/m-p/186696#M148798</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2018-05-12T20:10:40Z</dc:date>
    </item>
  </channel>
</rss>

