<?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: Calculating Date in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/calculating-date/m-p/4887227#M704669</link>
    <description>To expand on that:&lt;BR /&gt;&lt;BR /&gt;find /dir -type f -mtime +90 -exec rm {} \;&lt;BR /&gt;&lt;BR /&gt;- or -&lt;BR /&gt;&lt;BR /&gt;find /dir -type f -mtime +90 |xargs rm&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
    <pubDate>Tue, 22 Feb 2005 08:14:16 GMT</pubDate>
    <dc:creator>Pete Randall</dc:creator>
    <dc:date>2005-02-22T08:14:16Z</dc:date>
    <item>
      <title>Calculating Date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/calculating-date/m-p/4887225#M704667</link>
      <description>Hello All,&lt;BR /&gt;&lt;BR /&gt;I'm trying to create a script to remove files older than 90 days from a specific directory automatically. I have never done this before. I have no idea from where to start, so I'm calling your help.&lt;BR /&gt;&lt;BR /&gt;I don't know the best way to take the current date and subtract from it 90 days.&lt;BR /&gt;I was taking the current date this way:&lt;BR /&gt;DATE=`date "+%b %d"`&lt;BR /&gt;This way, i was receiving the DATE like this "FEB 22". I was thinking in use it because when we do "ls -al" we got the output like this one:&lt;BR /&gt;&lt;BR /&gt;-rw-------   1 ssbrmb     users         1200 Jan 10 08:50 .ICEauthority&lt;BR /&gt;-rw-------   1 ssbrmb     users          154 Jan 10 08:50 .TTauthority&lt;BR /&gt;-rw-------   1 ssbrmb     users           98 Jan 10 08:50 .Xauthority&lt;BR /&gt;-r--r--r--   1 ssbrmb     users          832 Nov 14  2000 .cshrc&lt;BR /&gt;drwxr-xr-x  11 ssbrmb     users         8192 Jan 12 09:25 .dt&lt;BR /&gt;-rwxr-xr-x   1 ssbrmb     users         5451 Dec 15 16:40 .dtprofile&lt;BR /&gt;-r--r--r--   1 ssbrmb     users          347 Nov 14  2000 .exrc&lt;BR /&gt;-r--r--r--   1 ssbrmb     users          334 Nov 14  2000 .login&lt;BR /&gt;-r--r--r--   1 ssbrmb     users          439 Nov 14  2000 .profile&lt;BR /&gt;-rw-------   1 ssbrmb     users         2440 Feb 21 08:52 .sh_history&lt;BR /&gt;&lt;BR /&gt;So i thought the best way to subtract the date was using the same format...&lt;BR /&gt;&lt;BR /&gt;But I don't get the solution...&lt;BR /&gt;&lt;BR /&gt;Can you help me?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Rafel M. Braga</description>
      <pubDate>Tue, 22 Feb 2005 08:05:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/calculating-date/m-p/4887225#M704667</guid>
      <dc:creator>Rafael Mendonça Braga</dc:creator>
      <dc:date>2005-02-22T08:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/calculating-date/m-p/4887226#M704668</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;why not use the find command ?&lt;BR /&gt;&lt;BR /&gt;find &lt;DIR&gt; -mtime "+90"&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Jean-Luc&lt;/DIR&gt;</description>
      <pubDate>Tue, 22 Feb 2005 08:11:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/calculating-date/m-p/4887226#M704668</guid>
      <dc:creator>Jean-Luc Oudart</dc:creator>
      <dc:date>2005-02-22T08:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/calculating-date/m-p/4887227#M704669</link>
      <description>To expand on that:&lt;BR /&gt;&lt;BR /&gt;find /dir -type f -mtime +90 -exec rm {} \;&lt;BR /&gt;&lt;BR /&gt;- or -&lt;BR /&gt;&lt;BR /&gt;find /dir -type f -mtime +90 |xargs rm&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Tue, 22 Feb 2005 08:14:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/calculating-date/m-p/4887227#M704669</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2005-02-22T08:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/calculating-date/m-p/4887228#M704670</link>
      <description>hi Rafel &lt;BR /&gt;&lt;BR /&gt;you can use the find command:&lt;BR /&gt;&lt;BR /&gt;find /path/to/dir -mtime +30 -exec ll {} \;&lt;BR /&gt;(gives a long list of files modified more than 30 days ago)&lt;BR /&gt;&lt;BR /&gt;find /path/to/dir -mtime +30 -exec rm {} \;&lt;BR /&gt;(to delete them)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;regards.&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Feb 2005 08:15:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/calculating-date/m-p/4887228#M704670</guid>
      <dc:creator>Henk Geurts</dc:creator>
      <dc:date>2005-02-22T08:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Date</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/calculating-date/m-p/4887229#M704671</link>
      <description>Thanks guys!!!</description>
      <pubDate>Tue, 22 Feb 2005 08:16:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/calculating-date/m-p/4887229#M704671</guid>
      <dc:creator>Rafael Mendonça Braga</dc:creator>
      <dc:date>2005-02-22T08:16:38Z</dc:date>
    </item>
  </channel>
</rss>

