<?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: zip folder using nifi in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/zip-folder-using-nifi/m-p/216939#M178848</link>
    <description>&lt;PRE&gt;&amp;lt;br&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/23208/hadoopuserhadoop.html" nodeid="23208" target="_blank"&gt;@Mark&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Method1:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Use &lt;STRONG&gt;Execute Process processor&lt;/STRONG&gt; with below configs:-&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="43863-executeprocess.png" style="width: 1061px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/16206i1A323FC9902A585E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="43863-executeprocess.png" alt="43863-executeprocess.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Properties:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Command&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;zip&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;Command Arguments&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;-rm /day/${now():format('yyyyMMdd')}.zip /day/${now():format('yyyyMMdd')}&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;i have configured above argument with Expression language but you can change above arguments as per your requirements.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;we are zipping the source folder and Deletes the original files after zipping.&lt;/LI&gt;&lt;LI&gt;If a directory becomes empty after removal of the files, the directory is also removed. &lt;/LI&gt;&lt;LI&gt;No deletions are done until zip has created the archive without error. &lt;/LI&gt;&lt;LI&gt;This is useful for conserving disk space, but is potentially dangerous removing all input files..!&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;(or)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Method2:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;we can zip the folder by using execute process processor then use execute stream command processor to delete the source directory.&lt;/P&gt;&lt;P&gt;Use Execute Process Processor and Configure the processor as below.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="43861-executeprocess.png" style="width: 1027px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/16207iBB77BE8FAC43B4CA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="43861-executeprocess.png" alt="43861-executeprocess.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Command&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;zip&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;Command Arguments&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;-r /day/${now():format('yyyyMMdd')}.zip /day/${now():format('yyyyMMdd')}&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;So in this processor we are using Expression language and Zip command and passing our desired zip folder name and source folder path.&lt;/P&gt;&lt;P&gt;Then use &lt;STRONG&gt;Execute Process(success relation) to&lt;/STRONG&gt; &lt;STRONG&gt;Execute Stream command processor&lt;/STRONG&gt; to delete the source directory.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;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="43862-executestreamcommand.png" style="width: 853px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/16208i508B7CFC7E320C09/image-size/medium?v=v2&amp;amp;px=400" role="button" title="43862-executestreamcommand.png" alt="43862-executestreamcommand.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;For removing directory we need to use a simple shell script&lt;/P&gt;&lt;PRE&gt;bash# cat del.sh
#!/bin/bash
rm -rf $1&lt;/PRE&gt;&lt;P&gt;the above shell script will expects an argument and we are passing that from &lt;STRONG&gt;command Arguments&lt;/STRONG&gt; property as&lt;/P&gt;&lt;PRE&gt;/day/${now():format('yyyyMMdd')}&lt;/PRE&gt;&lt;P&gt;so in this processor we are removing the directory.&lt;/P&gt;&lt;P&gt;Make sure nifi user having access to delete these directories.&lt;/P&gt;&lt;P&gt;You can choose the best method that fit for your case.&lt;/P&gt;</description>
    <pubDate>Sun, 18 Aug 2019 03:05:45 GMT</pubDate>
    <dc:creator>Shu_ashu</dc:creator>
    <dc:date>2019-08-18T03:05:45Z</dc:date>
    <item>
      <title>zip folder using nifi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/zip-folder-using-nifi/m-p/216936#M178845</link>
      <description>&lt;P&gt;I am having a YYYYMMdd folder in which I have files with YYYYMMddHHmm format.&lt;/P&gt;&lt;P&gt;ex:&lt;/P&gt;&lt;P&gt;/day/20171202/201712020000..201712022359&lt;/P&gt;&lt;P&gt;Can we zip the folder 20171202 to compress and put it back in the same location.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2017 18:53:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/zip-folder-using-nifi/m-p/216936#M178845</guid>
      <dc:creator>mark_hadoop</dc:creator>
      <dc:date>2017-12-05T18:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: zip folder using nifi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/zip-folder-using-nifi/m-p/216937#M178846</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/23208/hadoopuserhadoop.html" nodeid="23208" target="_blank"&gt;@Mark&lt;/A&gt;&lt;P&gt;You can do that by using &lt;/P&gt;&lt;P&gt;GetHDFS,GetFTP,GetSFTP processors by using &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Keep Source File
&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;false //by default it is set to false.&lt;/PRE&gt;&lt;P&gt;So once you configure GET processors then &lt;STRONG&gt;all the files in that directory will be deleted&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;GetHDFS 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="43827-gethdfs.png" style="width: 1437px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/16209i2479C082170F8506/image-size/medium?v=v2&amp;amp;px=400" role="button" title="43827-gethdfs.png" alt="43827-gethdfs.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Then use PutHDFS,PutFTP,PutSFTP processors and change the property&lt;/P&gt;&lt;P&gt;Compression codec
&lt;/P&gt;&lt;PRE&gt;BZIP&lt;/PRE&gt;&lt;P&gt;Directory&lt;/P&gt;&lt;PRE&gt;&amp;lt;same-directory-path-as-gethdfs-directory-info&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;PutHDFS 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="43828-puthdfs.png" style="width: 1431px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/16210i40CE925B4CC949AB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="43828-puthdfs.png" alt="43828-puthdfs.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Right now in Put hdfs processor has been configured the&lt;STRONG&gt; same directory as GetHDFS&lt;/STRONG&gt; processo,r we have configured puthdfs processor with Compression codec as BZIP.&lt;/P&gt;&lt;P&gt;When we are storing the data into &lt;STRONG&gt;HDFS directory we are compressing the files and storing them in HDFS directory&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;FLOW:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;GetHDFS(Success Relation) //get the files from hdfs directory and delete them in the source directory--&amp;gt;
PutHDFS //Compress the files and store them in the same directory source directory.&lt;/PRE&gt;&lt;P&gt;If you are thinking to merge the files then use merge content processor before PutHDFS processor.&lt;/P&gt;&lt;P&gt;Use the below reference to configure merge content processor.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.hortonworks.com/questions/149047/nifi-how-to-handle-with-mergecontent-processor.html?childToView=148309#answer-148309" target="_blank" rel="nofollow noopener noreferrer"&gt;https://community.hortonworks.com/questions/149047/nifi-how-to-handle-with-mergecontent-processor.html?childToView=148309#answer-148309&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 03:05:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/zip-folder-using-nifi/m-p/216937#M178846</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T03:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: zip folder using nifi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/zip-folder-using-nifi/m-p/216938#M178847</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/18929/yaswanthmuppireddy.html" nodeid="18929"&gt;@Shu&lt;/A&gt; &lt;/P&gt;&lt;P&gt;I tried the above as you said.&lt;/P&gt;&lt;P&gt;What I am getting is /day/20171202/YYYYMMddHHmm.bz2&lt;/P&gt;&lt;P&gt;what I am looking for is /day/20171202.zip&lt;/P&gt;&lt;P&gt;can you help me please&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2017 00:33:50 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/zip-folder-using-nifi/m-p/216938#M178847</guid>
      <dc:creator>mark_hadoop</dc:creator>
      <dc:date>2017-12-07T00:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: zip folder using nifi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/zip-folder-using-nifi/m-p/216939#M178848</link>
      <description>&lt;PRE&gt;&amp;lt;br&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/23208/hadoopuserhadoop.html" nodeid="23208" target="_blank"&gt;@Mark&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Method1:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Use &lt;STRONG&gt;Execute Process processor&lt;/STRONG&gt; with below configs:-&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="43863-executeprocess.png" style="width: 1061px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/16206i1A323FC9902A585E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="43863-executeprocess.png" alt="43863-executeprocess.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Properties:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Command&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;zip&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;Command Arguments&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;-rm /day/${now():format('yyyyMMdd')}.zip /day/${now():format('yyyyMMdd')}&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;i have configured above argument with Expression language but you can change above arguments as per your requirements.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;we are zipping the source folder and Deletes the original files after zipping.&lt;/LI&gt;&lt;LI&gt;If a directory becomes empty after removal of the files, the directory is also removed. &lt;/LI&gt;&lt;LI&gt;No deletions are done until zip has created the archive without error. &lt;/LI&gt;&lt;LI&gt;This is useful for conserving disk space, but is potentially dangerous removing all input files..!&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;(or)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Method2:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;we can zip the folder by using execute process processor then use execute stream command processor to delete the source directory.&lt;/P&gt;&lt;P&gt;Use Execute Process Processor and Configure the processor as below.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="43861-executeprocess.png" style="width: 1027px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/16207iBB77BE8FAC43B4CA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="43861-executeprocess.png" alt="43861-executeprocess.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Command&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;zip&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;Command Arguments&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;-r /day/${now():format('yyyyMMdd')}.zip /day/${now():format('yyyyMMdd')}&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;So in this processor we are using Expression language and Zip command and passing our desired zip folder name and source folder path.&lt;/P&gt;&lt;P&gt;Then use &lt;STRONG&gt;Execute Process(success relation) to&lt;/STRONG&gt; &lt;STRONG&gt;Execute Stream command processor&lt;/STRONG&gt; to delete the source directory.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;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="43862-executestreamcommand.png" style="width: 853px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/16208i508B7CFC7E320C09/image-size/medium?v=v2&amp;amp;px=400" role="button" title="43862-executestreamcommand.png" alt="43862-executestreamcommand.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;For removing directory we need to use a simple shell script&lt;/P&gt;&lt;PRE&gt;bash# cat del.sh
#!/bin/bash
rm -rf $1&lt;/PRE&gt;&lt;P&gt;the above shell script will expects an argument and we are passing that from &lt;STRONG&gt;command Arguments&lt;/STRONG&gt; property as&lt;/P&gt;&lt;PRE&gt;/day/${now():format('yyyyMMdd')}&lt;/PRE&gt;&lt;P&gt;so in this processor we are removing the directory.&lt;/P&gt;&lt;P&gt;Make sure nifi user having access to delete these directories.&lt;/P&gt;&lt;P&gt;You can choose the best method that fit for your case.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 03:05:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/zip-folder-using-nifi/m-p/216939#M178848</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T03:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: zip folder using nifi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/zip-folder-using-nifi/m-p/216940#M178849</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/18929/yaswanthmuppireddy.html" nodeid="18929" target="_blank"&gt;@Shu&lt;/A&gt; &lt;/P&gt;&lt;P&gt;I tried the above.&lt;/P&gt;&lt;P&gt;I am getting an error&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="42972-execute-process.jpg" style="width: 388px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/16205i14EEB2BA084DF291/image-size/medium?v=v2&amp;amp;px=400" role="button" title="42972-execute-process.jpg" alt="42972-execute-process.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have the directory and files, still I am getting this error.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 03:05:26 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/zip-folder-using-nifi/m-p/216940#M178849</guid>
      <dc:creator>mark_hadoop</dc:creator>
      <dc:date>2019-08-18T03:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: zip folder using nifi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/zip-folder-using-nifi/m-p/216941#M178850</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/23208/hadoopuserhadoop.html" nodeid="23208" target="_blank"&gt;@Mark&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;I think you are using Windows and windows won't have zip utility by default, Zip utility will be presented in linux env as i tried in linux.&lt;/P&gt;&lt;P&gt;To resolve this you need to download&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.microsoft.com/en-us/download/details.aspx?id=17657" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.microsoft.com/en-us/download/details.aspx?id=17657&lt;/A&gt; and run the .exe file. &lt;/P&gt;&lt;P&gt;In &lt;STRONG&gt;&lt;U&gt;Execute Process Processor&lt;/U&gt;&lt;/STRONG&gt; use&lt;/P&gt;&lt;P&gt;Command
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;C:\Program Files (x86)\Windows Resource Kits\Tools\compress.exe //path where compress.exe got installed&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Command Arguments&lt;/P&gt;&lt;PRE&gt;C:\&amp;lt;input directory&amp;gt; C:\&amp;lt;output-directory.zip&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;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="43888-executeprocess.png" style="width: 798px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/16203i931524EF50BFF924/image-size/medium?v=v2&amp;amp;px=400" role="button" title="43888-executeprocess.png" alt="43888-executeprocess.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So we are creating zip directory in Execute Process processor.&lt;/P&gt;&lt;P&gt;Your case Input directory like&lt;/P&gt;&lt;PRE&gt;C:\day\${now():format('yyyyMMdd')}&lt;/PRE&gt;&lt;P&gt;Output Directory&lt;/P&gt;&lt;PRE&gt;C:\day\${now():format('yyyyMMdd')}.zip&lt;/PRE&gt;&lt;P&gt;Then use &lt;STRONG&gt;&lt;U&gt;Execute Stream Command Processor&lt;/U&gt;&lt;/STRONG&gt; to delete the input Directory(Source directory).&lt;/P&gt;&lt;P&gt;We need to create .bat file that would delete the input directory in this processor.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;cmd&amp;gt;remove_dir.bat &lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;@RD /s/q %1&lt;/PRE&gt;&lt;P&gt;So the above script would get argument and delete the directory  we are passing that argument as our input directory.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What is /s and /Q?&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;RD [/S] [/Q] [drive:]path
/S      Removes all directories and files in the specified directory
        in addition to the directory itself.  Used to remove a directory
        tree.
/Q      Quiet mode, do not ask if ok to remove a directory tree with /S&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Configs:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Command Arguments
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;"C:\day\${now():format('yyyyMMdd')}"&lt;/PRE&gt;
&lt;/DIV&gt;&lt;P&gt;Command Path
&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;C:&amp;lt;delete-directory.bat file path&amp;gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;&lt;STRONG&gt;For testing i tried with below configs:-&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="43889-executestreamcommand.png" style="width: 679px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/16204i15D9C7F3EA9657F2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="43889-executestreamcommand.png" alt="43889-executestreamcommand.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In this processor we are deleting the input directory.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 03:05:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/zip-folder-using-nifi/m-p/216941#M178850</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T03:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: zip folder using nifi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/zip-folder-using-nifi/m-p/216942#M178851</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/18929/yaswanthmuppireddy.html" nodeid="18929"&gt;@Shu&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Thanks for the detailed explination.&lt;/P&gt;&lt;P&gt;I am using nifi 1.1 and in linux env.&lt;/P&gt;&lt;P&gt;Also the /day folder is in hdfs which is in linux.&lt;/P&gt;&lt;P&gt;Iam also wondered why zip was not working.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2017 22:26:22 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/zip-folder-using-nifi/m-p/216942#M178851</guid>
      <dc:creator>mark_hadoop</dc:creator>
      <dc:date>2017-12-08T22:26:22Z</dc:date>
    </item>
    <item>
      <title>Re: zip folder using nifi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/zip-folder-using-nifi/m-p/216943#M178852</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/23208/hadoopuserhadoop.html" nodeid="23208" target="_blank"&gt;@Mark&lt;/A&gt;
&lt;/P&gt;&lt;P&gt;Directory needs to be in local&lt;STRONG&gt; not in hadoop&lt;/STRONG&gt; directory to work with&lt;STRONG&gt; zip command&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Make sure zip is installed in your node.&lt;/P&gt;&lt;P&gt;Command to check zip is installed&lt;/P&gt;&lt;PRE&gt;#zip&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="42980-zip.png" style="width: 1662px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/16201iB7435CD6587EA119/image-size/medium?v=v2&amp;amp;px=400" role="button" title="42980-zip.png" alt="42980-zip.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;after executing zip if it shows output as above that means zip is installed on the node.&lt;/P&gt;&lt;P&gt;if not installed then do&lt;/P&gt;&lt;PRE&gt;#yum install zip&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;If you want to do zip the hdfs files then follow below steps:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; Use &lt;STRONG&gt;Get HDFS&lt;/STRONG&gt; processor to pick your files from HDFS,Use Configs for gethdfs same as my first answer&lt;/P&gt;&lt;P&gt;then use &lt;STRONG&gt;MergeContent&lt;/STRONG&gt; processor with&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="42982-merge.png" style="width: 1937px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/16202iB073A029C00666DF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="42982-merge.png" alt="42982-merge.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;As every &lt;STRONG&gt;flowfile from GetHDFS processor&lt;/STRONG&gt; will have &lt;STRONG&gt;path attribute&lt;/STRONG&gt; associated with it, we are using path attribute as our &lt;STRONG&gt;Correlation Attribute Name &lt;/STRONG&gt;in merge content processor. &lt;/P&gt;&lt;P&gt;Processor waits for &lt;STRONG&gt;1 min&lt;/STRONG&gt; and merges all the flow files that having &lt;STRONG&gt;same path attribute&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Change &lt;STRONG&gt;Keep Path&lt;/STRONG&gt; property as per your requirements.&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Keep Path&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;false&lt;/TD&gt;&lt;TD&gt;&lt;UL&gt;&lt;LI&gt;true&lt;/LI&gt;&lt;LI&gt;false&lt;/LI&gt;&lt;/UL&gt;&lt;/TD&gt;&lt;TD&gt;If using the Zip or Tar Merge Format, specifies whether or not the FlowFiles' paths should be included in their entry names; if using other merge strategy, this value is ignored&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;But you can change the configs as per your requirements by following below reference to configure merge content processor.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.hortonworks.com/questions/149047/nifi-how-to-handle-with-mergecontent-processor.html?childToView=148309#answer-148309" rel="nofollow noopener noreferrer" target="_blank"&gt;https://community.hortonworks.com/questions/149047/nifi-how-to-handle-with-mergecontent-processor.html?childToView=148309#answer-148309&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Then in &lt;STRONG&gt;Put HDFS&lt;/STRONG&gt; processor Use configs as my first answer and &lt;STRONG&gt;change property&lt;/STRONG&gt; to&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Compression codec
&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;NONE&lt;/PRE&gt;&lt;P&gt;Because we are doing zipping in merge content processor it self no need to do compression again in PutHDFS processor.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 03:05:04 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/zip-folder-using-nifi/m-p/216943#M178852</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T03:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: zip folder using nifi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/zip-folder-using-nifi/m-p/216944#M178853</link>
      <description>&lt;P&gt;&lt;A href="https://community.hortonworks.com/users/18929/yaswanthmuppireddy.html"&gt;@Shu&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.hortonworks.com/users/18929/yaswanthmuppireddy.html"&gt;&lt;BR /&gt;I&lt;/A&gt; also have same requirement to zip a folder in hdfs directly. I am using mergeContent processor with merge format ZIP, But  i am not able to get a single zipped file file after the merge content processor. &lt;/P&gt;</description>
      <pubDate>Thu, 21 Dec 2017 22:06:09 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/zip-folder-using-nifi/m-p/216944#M178853</guid>
      <dc:creator>abhash_kumar</dc:creator>
      <dc:date>2017-12-21T22:06:09Z</dc:date>
    </item>
  </channel>
</rss>

