<?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>topic Re: How to delete files older than 48 hours in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-delete-files-older-than-48-hours/m-p/2375286#M137731</link>
    <description>&lt;P&gt;No, Job is running successfully but not deleting files based on condition. I'm not sure about the condition which i have applied.    &lt;/P&gt;</description>
    <pubDate>Mon, 17 Aug 2020 05:06:37 GMT</pubDate>
    <dc:creator>prasanthkesana</dc:creator>
    <dc:date>2020-08-17T05:06:37Z</dc:date>
    <item>
      <title>How to delete files older than 48 hours</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-delete-files-older-than-48-hours/m-p/2375284#M137729</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;I have a requirement to delete old files based on date timestamp, &lt;/P&gt;&lt;P&gt;I found the component tFileProperties to fetch file properties &lt;/P&gt;&lt;P&gt;below is the sample job i have created by using the talend components&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tFileList---iterate-- &amp;gt; tFileProperties ---main---&amp;gt;tMap-------main---&amp;gt;tfileDelte    &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On tMap schema editor i have used condition to check mtime  in expression &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;((TalendDate.getCurrentDate()).getTime() - (Long)row1.mtime) &amp;gt; (8 * 24 * 3600000)  to delete files based on above condition. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please suggest any solution as per my requirement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Prasanth &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 04:32:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-delete-files-older-than-48-hours/m-p/2375284#M137729</guid>
      <dc:creator>prasanthkesana</dc:creator>
      <dc:date>2020-08-17T04:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to delete files older than 48 hours</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-delete-files-older-than-48-hours/m-p/2375285#M137730</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the problem with your current job design? Is the file deleted?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shong&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 05:01:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-delete-files-older-than-48-hours/m-p/2375285#M137730</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-17T05:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to delete files older than 48 hours</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-delete-files-older-than-48-hours/m-p/2375286#M137731</link>
      <description>&lt;P&gt;No, Job is running successfully but not deleting files based on condition. I'm not sure about the condition which i have applied.    &lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 05:06:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-delete-files-older-than-48-hours/m-p/2375286#M137731</guid>
      <dc:creator>prasanthkesana</dc:creator>
      <dc:date>2020-08-17T05:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to delete files older than 48 hours</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-delete-files-older-than-48-hours/m-p/2375287#M137732</link>
      <description>&lt;P&gt;if you just want to delete the files older than 48 hours,  change the expression to &lt;/P&gt;&lt;P&gt;((TalendDate.getCurrentDate()).getTime() - (Long)row1.mtime) &amp;gt; (2 * 24 * 3600000)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 06:57:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-delete-files-older-than-48-hours/m-p/2375287#M137732</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-17T06:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to delete files older than 48 hours</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-delete-files-older-than-48-hours/m-p/2375288#M137733</link>
      <description>&lt;P&gt;Hi Shong
I have tried the above condition already but not working.  &lt;/P&gt;&lt;P&gt;Is there any issue in the work flow of my job? &lt;/P&gt;&lt;P&gt;Below is the attached schema for tMap. &lt;/P&gt;&lt;P&gt;please suggest me any other alternative solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks 
Prasanth &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;


&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;
&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 07:09:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-delete-files-older-than-48-hours/m-p/2375288#M137733</guid>
      <dc:creator>prasanthkesana</dc:creator>
      <dc:date>2020-08-17T07:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to delete files older than 48 hours</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-delete-files-older-than-48-hours/m-p/2375289#M137734</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;The file name of tFileDelete component should be:&lt;/P&gt;&lt;P&gt;((String)globalMap.get("tFileList_1_CURRENT_FILEPATH"))&lt;/P&gt;&lt;P&gt;Can you check it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 07:16:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-delete-files-older-than-48-hours/m-p/2375289#M137734</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-17T07:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to delete files older than 48 hours</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-delete-files-older-than-48-hours/m-p/2375290#M137735</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;It was not configured, but now i have added it in file name of tFileDelete and tested still not working.     &lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 08:31:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-delete-files-older-than-48-hours/m-p/2375290#M137735</guid>
      <dc:creator>prasanthkesana</dc:creator>
      <dc:date>2020-08-17T08:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to delete files older than 48 hours</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-delete-files-older-than-48-hours/m-p/2375291#M137736</link>
      <description>&lt;P&gt;I have tested your work flow and I am sure it works. Any error do you have? Try to output the filename on tMap to check if the filter condition is working.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p000009IlAHAA0.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/152251iAAA80F84545E4A41/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000009IlAHAA0.png" alt="0693p000009IlAHAA0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 09:53:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-delete-files-older-than-48-hours/m-p/2375291#M137736</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-17T09:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to delete files older than 48 hours</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-delete-files-older-than-48-hours/m-p/2375292#M137737</link>
      <description>&lt;P&gt;Hi,

&lt;/P&gt;&lt;P&gt;I have tested the work flow now all files are deleting even the condition is set to before 2 days files has to be delete from current date . 
&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 10:38:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-delete-files-older-than-48-hours/m-p/2375292#M137737</guid>
      <dc:creator>prasanthkesana</dc:creator>
      <dc:date>2020-08-17T10:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to delete files older than 48 hours</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-delete-files-older-than-48-hours/m-p/2375293#M137738</link>
      <description>&lt;P&gt;Just create a new file for testing, if the new file is deleted also, there must be something wrong in your job. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 15:49:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-delete-files-older-than-48-hours/m-p/2375293#M137738</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-17T15:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to delete files older than 48 hours</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-delete-files-older-than-48-hours/m-p/2375294#M137739</link>
      <description>&lt;P&gt;Hi 

&lt;/P&gt;&lt;P&gt;i have created new file and run the job,&lt;/P&gt;&lt;P&gt;If i used this expression &lt;B&gt;((TalendDate.getCurrentDate()).getTime() - (Long)row1.mtime) &amp;gt; (2 * 24 * 3600000) &lt;/B&gt;files are not deleting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For this expression &lt;B&gt;((TalendDate.getCurrentDate()).getTime() - (Long)row1.mtime)+86400000 &amp;gt; (31* 24 * 3600000) &lt;/B&gt;all files are deleting at once. I found this while searching for the suitable expression it will delete before 31 days old files but deleting all. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Prasanth&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Aug 2020 01:51:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-delete-files-older-than-48-hours/m-p/2375294#M137739</guid>
      <dc:creator>prasanthkesana</dc:creator>
      <dc:date>2020-08-18T01:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to delete files older than 48 hours</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-delete-files-older-than-48-hours/m-p/2375295#M137740</link>
      <description>&lt;P&gt;I had to replace the math with:&lt;/P&gt;&lt;P&gt;Long.valueOf(2) * Long.valueOf(24) * Long.valueOf(3600000)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As the int values kept going negative due to size.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Oct 2021 21:35:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-delete-files-older-than-48-hours/m-p/2375295#M137740</guid>
      <dc:creator>cmills</dc:creator>
      <dc:date>2021-10-04T21:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to delete files older than 48 hours</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-delete-files-older-than-48-hours/m-p/2375296#M137741</link>
      <description>&lt;P&gt;Hello @Shicong Hong​&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1] Delete files older than 48 hrs &lt;/P&gt;&lt;P&gt;condition in tMap - &amp;gt; ((TalendDate.getCurrentDate()).getTime() - (Long)row1.mtime) &amp;gt; (2 * 24 * 3600000)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2] The file name of tFileDelete component should be:&lt;/P&gt;&lt;P&gt;((String)globalMap.get("tFileList_1_CURRENT_FILEPATH"))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the solution this works for me!&lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2021 10:44:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-delete-files-older-than-48-hours/m-p/2375296#M137741</guid>
      <dc:creator>ykuwar</dc:creator>
      <dc:date>2021-12-20T10:44:38Z</dc:date>
    </item>
  </channel>
</rss>

