<?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: batch compressing dated files in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/batch-compressing-dated-files/m-p/2935185#M112463</link>
    <description>Jeff, the fact that you've spelled rcpt_aud both with and without the extra "e" (recpt_aud) makes me wonder what you actually tried to find on.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
    <pubDate>Tue, 25 Mar 2003 15:40:37 GMT</pubDate>
    <dc:creator>Pete Randall</dc:creator>
    <dc:date>2003-03-25T15:40:37Z</dc:date>
    <item>
      <title>batch compressing dated files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/batch-compressing-dated-files/m-p/2935174#M112452</link>
      <description>I have reports that are put into directories and are named by only the date(20030324.txt). I have these files dating back to the begining of the year.  I want to compress all the files older then today minus 30 or everything older then this month (compress &amp;lt; 200303*).  I don't know awk or pearl.</description>
      <pubDate>Tue, 25 Mar 2003 14:53:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/batch-compressing-dated-files/m-p/2935174#M112452</guid>
      <dc:creator>Jeff Hagstrom</dc:creator>
      <dc:date>2003-03-25T14:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: batch compressing dated files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/batch-compressing-dated-files/m-p/2935175#M112453</link>
      <description>for i in `find /dir_name -mtime +30`&lt;BR /&gt;do&lt;BR /&gt;compress $i&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Tue, 25 Mar 2003 14:55:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/batch-compressing-dated-files/m-p/2935175#M112453</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2003-03-25T14:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: batch compressing dated files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/batch-compressing-dated-files/m-p/2935176#M112454</link>
      <description>Hi Jeff:&lt;BR /&gt;&lt;BR /&gt;# cd &lt;DIR&gt;&lt;BR /&gt;# find . -type f -xdev -mtime +30 -exec gzip {} \;&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;/DIR&gt;</description>
      <pubDate>Tue, 25 Mar 2003 14:59:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/batch-compressing-dated-files/m-p/2935176#M112454</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2003-03-25T14:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: batch compressing dated files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/batch-compressing-dated-files/m-p/2935177#M112455</link>
      <description>Hi Jeff,&lt;BR /&gt;&lt;BR /&gt;Try the following&lt;BR /&gt;&lt;BR /&gt;find /start_dir -mtime +30 -a  -name "2003*.*" -exec compress {} \;&lt;BR /&gt;&lt;BR /&gt;Notes:&lt;BR /&gt;&lt;BR /&gt;1) Replace /start_dir with a relevant dir root to ease the search burden&lt;BR /&gt;&lt;BR /&gt;2) The -a is a logical AND operator in the command&lt;BR /&gt;&lt;BR /&gt;3) Try the command first with ll in place of compress to verify just WHICH files will be compressed&lt;BR /&gt;&lt;BR /&gt;4) I'd recommend gzip over compress - generally compresses better.&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Jeff</description>
      <pubDate>Tue, 25 Mar 2003 15:01:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/batch-compressing-dated-files/m-p/2935177#M112455</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2003-03-25T15:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: batch compressing dated files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/batch-compressing-dated-files/m-p/2935178#M112456</link>
      <description>Well, if the filename is all you can trust then you must only use the filename for date calculations. We need to create a filename 30 days ago and any filename less than that (since you have wisely chosen YYYYMMDD format) is a candidate for compression.&lt;BR /&gt;&lt;BR /&gt;I'll assume that you have cd'ed to the target directory.&lt;BR /&gt;&lt;BR /&gt;P30FNAME=$(caljd.sh -y -s $(caljd.sh -p 30))".txt"&lt;BR /&gt;&lt;BR /&gt;ls | while read FNAME&lt;BR /&gt; do&lt;BR /&gt;   if [[ -f ${FNAME} ]]&lt;BR /&gt;     then&lt;BR /&gt;       if [[ "${FNAME}" &amp;lt; "${P30FNAME}" ]]&lt;BR /&gt;         then&lt;BR /&gt;           echo "Compress this file"&lt;BR /&gt;         fi&lt;BR /&gt;     fi&lt;BR /&gt;  done&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;That should do it and here's caljd.sh to do the date calculations.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 25 Mar 2003 15:21:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/batch-compressing-dated-files/m-p/2935178#M112456</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2003-03-25T15:21:40Z</dc:date>
    </item>
    <item>
      <title>Re: batch compressing dated files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/batch-compressing-dated-files/m-p/2935179#M112457</link>
      <description>Does -mtime look at the date on the file or the filename?</description>
      <pubDate>Tue, 25 Mar 2003 15:21:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/batch-compressing-dated-files/m-p/2935179#M112457</guid>
      <dc:creator>Jeff Hagstrom</dc:creator>
      <dc:date>2003-03-25T15:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: batch compressing dated files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/batch-compressing-dated-files/m-p/2935180#M112458</link>
      <description>-mtime looks at mod time.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Tue, 25 Mar 2003 15:24:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/batch-compressing-dated-files/m-p/2935180#M112458</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2003-03-25T15:24:14Z</dc:date>
    </item>
    <item>
      <title>Re: batch compressing dated files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/batch-compressing-dated-files/m-p/2935181#M112459</link>
      <description>If you need to depend on the file's name, then you're better off with Clay's method.&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Tue, 25 Mar 2003 15:25:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/batch-compressing-dated-files/m-p/2935181#M112459</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2003-03-25T15:25:04Z</dc:date>
    </item>
    <item>
      <title>Re: batch compressing dated files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/batch-compressing-dated-files/m-p/2935182#M112460</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;-mtime +X where X=# days is the time of last modification.&lt;BR /&gt;&lt;BR /&gt;atime = access time&lt;BR /&gt;&lt;BR /&gt;ctime = change of status time&lt;BR /&gt;&lt;BR /&gt;Rgds,&lt;BR /&gt;Jeff</description>
      <pubDate>Tue, 25 Mar 2003 15:25:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/batch-compressing-dated-files/m-p/2935182#M112460</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2003-03-25T15:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: batch compressing dated files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/batch-compressing-dated-files/m-p/2935183#M112461</link>
      <description>[NIKE-1 find /u/online/rcpt_aud -mtime +30 -a -name "2003*.*" -exec ll {} \; &lt;BR /&gt;find: cannot stat&lt;BR /&gt; /u/online/recpt_aud     &lt;BR /&gt;&lt;BR /&gt;????????                                 &lt;BR /&gt;</description>
      <pubDate>Tue, 25 Mar 2003 15:36:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/batch-compressing-dated-files/m-p/2935183#M112461</guid>
      <dc:creator>Jeff Hagstrom</dc:creator>
      <dc:date>2003-03-25T15:36:22Z</dc:date>
    </item>
    <item>
      <title>Re: batch compressing dated files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/batch-compressing-dated-files/m-p/2935184#M112462</link>
      <description>Hi (again) Jeff:&lt;BR /&gt;&lt;BR /&gt;The error, "cannot stat", means that there is no such directory in this case.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 25 Mar 2003 15:38:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/batch-compressing-dated-files/m-p/2935184#M112462</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2003-03-25T15:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: batch compressing dated files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/batch-compressing-dated-files/m-p/2935185#M112463</link>
      <description>Jeff, the fact that you've spelled rcpt_aud both with and without the extra "e" (recpt_aud) makes me wonder what you actually tried to find on.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Tue, 25 Mar 2003 15:40:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/batch-compressing-dated-files/m-p/2935185#M112463</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2003-03-25T15:40:37Z</dc:date>
    </item>
  </channel>
</rss>

