<?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: I need a perl script to delete files on the ftp server older then 1 week in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/i-need-a-perl-script-to-delete-files-on-the-ftp-server-older/m-p/3161945#M72998</link>
    <description>no need for perl&lt;BR /&gt;&lt;BR /&gt;find / -name "cm*" -mtime +7 -exec rm {} \; &lt;BR /&gt;&lt;BR /&gt;or something like that... ( man find ).</description>
    <pubDate>Mon, 12 Jan 2004 11:33:58 GMT</pubDate>
    <dc:creator>Olivier Drouin</dc:creator>
    <dc:date>2004-01-12T11:33:58Z</dc:date>
    <item>
      <title>I need a perl script to delete files on the ftp server older then 1 week</title>
      <link>https://community.hpe.com/t5/operating-system-linux/i-need-a-perl-script-to-delete-files-on-the-ftp-server-older/m-p/3161944#M72997</link>
      <description>hi&lt;BR /&gt;&lt;BR /&gt;I need a perl script to delete all files&lt;BR /&gt;beginning with cm* and older then 1 week&lt;BR /&gt;via ftp, on the ftp server.&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;chris &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Jan 2004 11:24:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/i-need-a-perl-script-to-delete-files-on-the-ftp-server-older/m-p/3161944#M72997</guid>
      <dc:creator>'chris'</dc:creator>
      <dc:date>2004-01-12T11:24:45Z</dc:date>
    </item>
    <item>
      <title>Re: I need a perl script to delete files on the ftp server older then 1 week</title>
      <link>https://community.hpe.com/t5/operating-system-linux/i-need-a-perl-script-to-delete-files-on-the-ftp-server-older/m-p/3161945#M72998</link>
      <description>no need for perl&lt;BR /&gt;&lt;BR /&gt;find / -name "cm*" -mtime +7 -exec rm {} \; &lt;BR /&gt;&lt;BR /&gt;or something like that... ( man find ).</description>
      <pubDate>Mon, 12 Jan 2004 11:33:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/i-need-a-perl-script-to-delete-files-on-the-ftp-server-older/m-p/3161945#M72998</guid>
      <dc:creator>Olivier Drouin</dc:creator>
      <dc:date>2004-01-12T11:33:58Z</dc:date>
    </item>
    <item>
      <title>Re: I need a perl script to delete files on the ftp server older then 1 week</title>
      <link>https://community.hpe.com/t5/operating-system-linux/i-need-a-perl-script-to-delete-files-on-the-ftp-server-older/m-p/3161946#M72999</link>
      <description>but it's external ftp server &lt;BR /&gt;and I can connect only via ftp.</description>
      <pubDate>Mon, 12 Jan 2004 11:40:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/i-need-a-perl-script-to-delete-files-on-the-ftp-server-older/m-p/3161946#M72999</guid>
      <dc:creator>'chris'</dc:creator>
      <dc:date>2004-01-12T11:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: I need a perl script to delete files on the ftp server older then 1 week</title>
      <link>https://community.hpe.com/t5/operating-system-linux/i-need-a-perl-script-to-delete-files-on-the-ftp-server-older/m-p/3161947#M73000</link>
      <description>Much easier would be to open ssh and remotely run the command I gave you over ssh.&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Jan 2004 11:51:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/i-need-a-perl-script-to-delete-files-on-the-ftp-server-older/m-p/3161947#M73000</guid>
      <dc:creator>Olivier Drouin</dc:creator>
      <dc:date>2004-01-12T11:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: I need a perl script to delete files on the ftp server older then 1 week</title>
      <link>https://community.hpe.com/t5/operating-system-linux/i-need-a-perl-script-to-delete-files-on-the-ftp-server-older/m-p/3161948#M73001</link>
      <description>on linux yes, &lt;BR /&gt;but the external server is AS400&lt;BR /&gt;and doesn't understand ssh&lt;BR /&gt;&lt;BR /&gt;I CAN CONNECT ONLY VIA FTP&lt;BR /&gt;and no other way.&lt;BR /&gt;&lt;BR /&gt;so I need a script&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;chris    &lt;BR /&gt;</description>
      <pubDate>Mon, 12 Jan 2004 12:41:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/i-need-a-perl-script-to-delete-files-on-the-ftp-server-older/m-p/3161948#M73001</guid>
      <dc:creator>'chris'</dc:creator>
      <dc:date>2004-01-12T12:41:55Z</dc:date>
    </item>
    <item>
      <title>Re: I need a perl script to delete files on the ftp server older then 1 week</title>
      <link>https://community.hpe.com/t5/operating-system-linux/i-need-a-perl-script-to-delete-files-on-the-ftp-server-older/m-p/3161949#M73002</link>
      <description>record in a file a session doing only&lt;BR /&gt;&lt;BR /&gt;ls -al &lt;BR /&gt;&lt;BR /&gt;then parse the file, and create a command file deleting only the files matching yout criteria.&lt;BR /&gt;&lt;BR /&gt;ans issue the command file</description>
      <pubDate>Mon, 12 Jan 2004 12:56:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/i-need-a-perl-script-to-delete-files-on-the-ftp-server-older/m-p/3161949#M73002</guid>
      <dc:creator>labadie_1</dc:creator>
      <dc:date>2004-01-12T12:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: I need a perl script to delete files on the ftp server older then 1 week</title>
      <link>https://community.hpe.com/t5/operating-system-linux/i-need-a-perl-script-to-delete-files-on-the-ftp-server-older/m-p/3161950#M73003</link>
      <description>sounds like a job for expect, run from cron.</description>
      <pubDate>Mon, 12 Jan 2004 16:28:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/i-need-a-perl-script-to-delete-files-on-the-ftp-server-older/m-p/3161950#M73003</guid>
      <dc:creator>Paul Cross_1</dc:creator>
      <dc:date>2004-01-12T16:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: I need a perl script to delete files on the ftp server older then 1 week</title>
      <link>https://community.hpe.com/t5/operating-system-linux/i-need-a-perl-script-to-delete-files-on-the-ftp-server-older/m-p/3161951#M73004</link>
      <description>What you can do is to open the ftp connection in a perl script using open2, which means you have a two way connection to the shell command, in this case ftp.&lt;BR /&gt;Login, go the the directory and do ls -lt cm*. There find the file that is old enough to delete and then use all filename and all older to delete.&lt;BR /&gt;&lt;BR /&gt;First check by running from the command line if your AS/400 ftp server supports the ls -lt and then I might give it a start by writing something for you... Or perhaps Procura sees this thread and does it...</description>
      <pubDate>Wed, 14 Jan 2004 05:24:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/i-need-a-perl-script-to-delete-files-on-the-ftp-server-older/m-p/3161951#M73004</guid>
      <dc:creator>Elmar P. Kolkman</dc:creator>
      <dc:date>2004-01-14T05:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: I need a perl script to delete files on the ftp server older then 1 week</title>
      <link>https://community.hpe.com/t5/operating-system-linux/i-need-a-perl-script-to-delete-files-on-the-ftp-server-older/m-p/3161952#M73005</link>
      <description>hi elmar&lt;BR /&gt;&lt;BR /&gt;what do you mean with exactly&lt;BR /&gt;" old enough to delete with ls -lt cm* " ?&lt;BR /&gt;&lt;BR /&gt;how old files will be deleted ?&lt;BR /&gt;this is very important for me to know.&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;chris&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Jan 2004 07:53:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/i-need-a-perl-script-to-delete-files-on-the-ftp-server-older/m-p/3161952#M73005</guid>
      <dc:creator>'chris'</dc:creator>
      <dc:date>2004-01-14T07:53:24Z</dc:date>
    </item>
    <item>
      <title>Re: I need a perl script to delete files on the ftp server older then 1 week</title>
      <link>https://community.hpe.com/t5/operating-system-linux/i-need-a-perl-script-to-delete-files-on-the-ftp-server-older/m-p/3161953#M73006</link>
      <description>What you need to do is in the perl script find, in the output of 'ls -lt cm*', find the first file that's older then the 1 week limit you set and delete that file and everyone that comes next. In pseudo perl, it would become something like:&lt;BR /&gt;&lt;BR /&gt;my found_delete=0;&lt;BR /&gt;my delete_from=currentdate - 1week;&lt;BR /&gt;while (line=readline(FI)) {&lt;BR /&gt;   if (!found_delete) {&lt;BR /&gt;      pd=parse_date(line);&lt;BR /&gt;      if (pd &amp;lt; delete_from) {&lt;BR /&gt;         found_delete=1;&lt;BR /&gt;      }&lt;BR /&gt;   }&lt;BR /&gt;   if (found_delete) {&lt;BR /&gt;      writeline(FO,"DEL ".getfile(line));&lt;BR /&gt;   }&lt;BR /&gt;}&lt;BR /&gt;</description>
      <pubDate>Thu, 15 Jan 2004 01:06:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/i-need-a-perl-script-to-delete-files-on-the-ftp-server-older/m-p/3161953#M73006</guid>
      <dc:creator>Elmar P. Kolkman</dc:creator>
      <dc:date>2004-01-15T01:06:56Z</dc:date>
    </item>
  </channel>
</rss>

