<?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 nifi processor cron schedule-avoiding multiple run in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/nifi-processor-cron-schedule-avoiding-multiple-run/m-p/177052#M139302</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have scheduled a getfile processor in nifi on cron schedule, running every minute (0 0/1 * * * ?).&lt;/P&gt;&lt;P&gt;The above runs properly and gets a file every minute, but the processor is running multiple times(atleast 2-3) and showing warning almost every time (because it could not ingest the file, as it has ingested already and no file is present).&lt;/P&gt;&lt;P&gt;How to avoid this, and make the processor stop till next schedule once the file is ingested.&lt;/P&gt;&lt;P&gt;Could you please suggest&lt;/P&gt;</description>
    <pubDate>Mon, 30 Oct 2017 23:07:19 GMT</pubDate>
    <dc:creator>mark_hadoop</dc:creator>
    <dc:date>2017-10-30T23:07:19Z</dc:date>
    <item>
      <title>nifi processor cron schedule-avoiding multiple run</title>
      <link>https://community.cloudera.com/t5/Support-Questions/nifi-processor-cron-schedule-avoiding-multiple-run/m-p/177052#M139302</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have scheduled a getfile processor in nifi on cron schedule, running every minute (0 0/1 * * * ?).&lt;/P&gt;&lt;P&gt;The above runs properly and gets a file every minute, but the processor is running multiple times(atleast 2-3) and showing warning almost every time (because it could not ingest the file, as it has ingested already and no file is present).&lt;/P&gt;&lt;P&gt;How to avoid this, and make the processor stop till next schedule once the file is ingested.&lt;/P&gt;&lt;P&gt;Could you please suggest&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2017 23:07:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/nifi-processor-cron-schedule-avoiding-multiple-run/m-p/177052#M139302</guid>
      <dc:creator>mark_hadoop</dc:creator>
      <dc:date>2017-10-30T23:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: nifi processor cron schedule-avoiding multiple run</title>
      <link>https://community.cloudera.com/t5/Support-Questions/nifi-processor-cron-schedule-avoiding-multiple-run/m-p/177053#M139303</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/23208/hadoopuserhadoop.html" nodeid="23208"&gt;@Hadoop User&lt;/A&gt;
&lt;/P&gt;&lt;OL&gt;
&lt;LI&gt;Use &lt;STRONG&gt;ListFile Processor &lt;/STRONG&gt;and run that in &lt;STRONG&gt;cron schedule for every minute&lt;/STRONG&gt;, this processor will &lt;STRONG&gt;store the state &lt;/STRONG&gt;and &lt;STRONG&gt;wont return any warning if there is no new file.&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;Then you can use&lt;STRONG&gt; FetchFile processor &lt;/STRONG&gt;to pull the listed files from &lt;STRONG&gt;ListFile processor&lt;/STRONG&gt;.&lt;/LI&gt;&lt;LI&gt;As these processors &lt;STRONG&gt;won't delete&lt;/STRONG&gt; the&lt;STRONG&gt; file&lt;/STRONG&gt; from your directory once fetch has been done(like getfile processor),&lt;/LI&gt;&lt;LI&gt;if you want to delete those files from directory then use&lt;STRONG&gt; ExecuteStreamCommand processor &lt;/STRONG&gt;and write a shell script which can &lt;STRONG&gt;get the filename&lt;/STRONG&gt; from to &lt;STRONG&gt;flowfile attribute &lt;/STRONG&gt;and pass that attribute to your script.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Flow:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;1.ListFile //list all the files from directory.
2.FetchFile //fetch the listed file.
3.ExecuteStreamCommand //shell script to delete file from directory.&lt;/PRE&gt;&lt;P&gt;Refer to below link how to pass attributes to the &lt;STRONG&gt;ExecuteStreamCommand&lt;/STRONG&gt; processor script.&lt;/P&gt;&lt;P&gt;&lt;A href="https://pierrevillard.com/2016/03/09/transform-data-with-apache-nifi/" target="_blank"&gt;https://pierrevillard.com/2016/03/09/transform-data-with-apache-nifi/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2017 00:00:53 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/nifi-processor-cron-schedule-avoiding-multiple-run/m-p/177053#M139303</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2017-10-31T00:00:53Z</dc:date>
    </item>
  </channel>
</rss>

