<?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: Compressing files in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/compressing-files/m-p/2722819#M945633</link>
    <description>Hello, you can compress all the files except the last one, in this way if Oracle is still writing to the file you don't compress it, or, you can check the size of each file before compression, if the file is in the maximum size (200mb in your case) then  Oracle as finish writing.&lt;BR /&gt;&lt;BR /&gt;Bruno Cunha</description>
    <pubDate>Tue, 14 May 2002 07:22:58 GMT</pubDate>
    <dc:creator>Bruno Cunha</dc:creator>
    <dc:date>2002-05-14T07:22:58Z</dc:date>
    <item>
      <title>Compressing files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compressing-files/m-p/2722809#M945623</link>
      <description>Greetings,&lt;BR /&gt;&lt;BR /&gt;I have and oracle database 8.1.7.3 that generates a lot of archive logs, each one is 200 Mb. I have croned a job every 15 minutes that checks the directory and if it finds any new files, it will compress them. &lt;BR /&gt;&lt;BR /&gt;Now, here is the question:&lt;BR /&gt;&lt;BR /&gt;If the Oracle Archiver process happens to start archiving a file but has not yet completed writing the entire content of the file to disk, if my croned compress job kicks in, will it be able to compress that file even if Oracle has not finished with it yet ? I am a little paranoid, because if the system lets the compress to go through, then I may have corrupted the archive logs.&lt;BR /&gt;&lt;BR /&gt;In other words, does HP-UX prevent other processes from accessing the file ? Bear in mind that compress reads the file and writes to a new file with *.Z and removes the original one.&lt;BR /&gt;&lt;BR /&gt;Any thoughts would be helpful.&lt;BR /&gt;&lt;BR /&gt;Thank you.-</description>
      <pubDate>Mon, 13 May 2002 19:58:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compressing-files/m-p/2722809#M945623</guid>
      <dc:creator>Aziz Zouagui</dc:creator>
      <dc:date>2002-05-13T19:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: Compressing files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compressing-files/m-p/2722810#M945624</link>
      <description>The simple answer is no; that is up to you.</description>
      <pubDate>Mon, 13 May 2002 20:00:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compressing-files/m-p/2722810#M945624</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-05-13T20:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: Compressing files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compressing-files/m-p/2722811#M945625</link>
      <description>You can of course use the fuser command to see if oracle stil has the file open. Once oracle has finished writing out the file it doesn't open it again so you can safely compress it.&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;Duncan</description>
      <pubDate>Mon, 13 May 2002 20:04:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compressing-files/m-p/2722811#M945625</guid>
      <dc:creator>Duncan Edmonstone</dc:creator>
      <dc:date>2002-05-13T20:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: Compressing files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compressing-files/m-p/2722812#M945626</link>
      <description>One thing that you could do is determine if a file has been modified within some period of time. If not then it is safe to compress it. Here is one method:&lt;BR /&gt;&lt;BR /&gt;FNAME="myfile"&lt;BR /&gt;SECONDS=600&lt;BR /&gt;fileage.pl -m -s ${SECONDS} ${FNAME}&lt;BR /&gt;STAT=$?&lt;BR /&gt;if [ ${STAT} -eq 0 ]&lt;BR /&gt;  then&lt;BR /&gt;    echo "File: ${FNAME} has not been modified in the last ${SECONDS} seconds; it is safe to compress."&lt;BR /&gt;  else&lt;BR /&gt;    echo "File ${FNAME} has been modified; not safe to compress."&lt;BR /&gt;  fi&lt;BR /&gt;&lt;BR /&gt;I've attached fileage.pl; invoke fileage.pl without arguments for full usage.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 13 May 2002 20:08:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compressing-files/m-p/2722812#M945626</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-05-13T20:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: Compressing files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compressing-files/m-p/2722813#M945627</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;I have just read the man page for compress and it says this:&lt;BR /&gt;&lt;BR /&gt;Access Control Lists&lt;BR /&gt;compress retains a file's access control list when compressing and expanding data.&lt;BR /&gt;&lt;BR /&gt;I think this is saying it basically locks the file could one of the guru's comment on this.&lt;BR /&gt;&lt;BR /&gt;cheers&lt;BR /&gt;John.</description>
      <pubDate>Mon, 13 May 2002 20:45:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compressing-files/m-p/2722813#M945627</guid>
      <dc:creator>John Carr_2</dc:creator>
      <dc:date>2002-05-13T20:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: Compressing files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compressing-files/m-p/2722814#M945628</link>
      <description>Sorry, that dog won't hunt. ACL's are a set of extended permisssions. All that is saying is that both the compressed and uncompressed forms of the file retain the original's ACL's (if supported by the filesystem and provided that the ACL's have been set for the file in question.)</description>
      <pubDate>Mon, 13 May 2002 20:53:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compressing-files/m-p/2722814#M945628</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-05-13T20:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: Compressing files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compressing-files/m-p/2722815#M945629</link>
      <description>John,&lt;BR /&gt;&lt;BR /&gt;If you are compressing FILEA and some process is still writing to it, and the compress completes, then the original file is DELETED, meaning the process still writing to FILEA won't be writing to squat (actually never-never-land).&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Mon, 13 May 2002 20:56:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compressing-files/m-p/2722815#M945629</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-05-13T20:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: Compressing files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compressing-files/m-p/2722816#M945630</link>
      <description>Hey guys,&lt;BR /&gt;&lt;BR /&gt;I appreciate all the input I am getting. &lt;BR /&gt;I like the fuser suggestion, I will have the job check the fuser before compressing the file, if there is a process list next to the file, then either sleep for a while and try again or abort to the next file and come back to the busy one later.&lt;BR /&gt;&lt;BR /&gt;Please if there is a better suggestion, do not hesitate to update the forum.&lt;BR /&gt;&lt;BR /&gt;Thank you for the feedback.&lt;BR /&gt;</description>
      <pubDate>Mon, 13 May 2002 21:33:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compressing-files/m-p/2722816#M945630</guid>
      <dc:creator>Aziz Zouagui</dc:creator>
      <dc:date>2002-05-13T21:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: Compressing files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compressing-files/m-p/2722817#M945631</link>
      <description>Hi Aziz,&lt;BR /&gt;&lt;BR /&gt; I think the question boils down to...Why are you compressing them?&lt;BR /&gt;If it's disk space...Then as Clay puts it "That's dog's hunting way too much!".&lt;BR /&gt;In that case you really need to extend the VG to hold proper log count/length/size.&lt;BR /&gt;If it's to backup &amp;amp; save tape space then I'd recommend you mirror the VG &amp;amp; lvsplit the mirror out prior to compressing &amp;amp; archiving then lvmerge it back in. If redundancy is a major concern &amp;amp; you're nervous about having just one copy for *any* time period then keep 2 mirror copies &amp;amp; you'll always have at least 2 copies on-line.&lt;BR /&gt;If you just want to "roll" the logs, I believe Oracle handles that as well. I think you can mv the file to a relevant, time-stamped filename prior to compressing it &amp;amp; Oracle will start a new log...mind you I'm not an Oracle expert but I'm sure one will correct me if I'm mistaken.&lt;BR /&gt;&lt;BR /&gt;Rgds,&lt;BR /&gt;Jeff</description>
      <pubDate>Tue, 14 May 2002 01:02:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compressing-files/m-p/2722817#M945631</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2002-05-14T01:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: Compressing files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compressing-files/m-p/2722818#M945632</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;as A.Clay and Harry make clear the file is not locked presumably even if you fuser before start of compress another process can effectively attach to file during compress and think it is writing to it.&lt;BR /&gt;&lt;BR /&gt;I would be tempted to rename the file before compression commences to ensure this cannot happen.&lt;BR /&gt;&lt;BR /&gt;As Jeff points out the real solution is to pick another alternative.&lt;BR /&gt;&lt;BR /&gt;cheers&lt;BR /&gt;John.</description>
      <pubDate>Tue, 14 May 2002 05:49:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compressing-files/m-p/2722818#M945632</guid>
      <dc:creator>John Carr_2</dc:creator>
      <dc:date>2002-05-14T05:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: Compressing files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compressing-files/m-p/2722819#M945633</link>
      <description>Hello, you can compress all the files except the last one, in this way if Oracle is still writing to the file you don't compress it, or, you can check the size of each file before compression, if the file is in the maximum size (200mb in your case) then  Oracle as finish writing.&lt;BR /&gt;&lt;BR /&gt;Bruno Cunha</description>
      <pubDate>Tue, 14 May 2002 07:22:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compressing-files/m-p/2722819#M945633</guid>
      <dc:creator>Bruno Cunha</dc:creator>
      <dc:date>2002-05-14T07:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: Compressing files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compressing-files/m-p/2722820#M945634</link>
      <description>fuser -fu &lt;FILE&gt; will give list of processes against this file.&lt;BR /&gt;&lt;BR /&gt;In case of recovery, you would have to uncompress the file(s) as they're requested.&lt;BR /&gt;This might be a bit tricky if you don't have the space for it !&lt;BR /&gt;&lt;BR /&gt;My opinion would be that you should have the space for the archive log files.&lt;/FILE&gt;</description>
      <pubDate>Tue, 14 May 2002 08:46:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compressing-files/m-p/2722820#M945634</guid>
      <dc:creator>Jean-Luc Oudart</dc:creator>
      <dc:date>2002-05-14T08:46:16Z</dc:date>
    </item>
    <item>
      <title>Re: Compressing files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compressing-files/m-p/2722821#M945635</link>
      <description>You could use find with a&lt;BR /&gt;timestamp file to compress&lt;BR /&gt;all uncomressed files older&lt;BR /&gt;than a timestamp file.&lt;BR /&gt;Something like:&lt;BR /&gt;&lt;BR /&gt;touch compress.$$&lt;BR /&gt;&lt;BR /&gt;sleep 30&lt;BR /&gt;&lt;BR /&gt;find . -name arch\*.arc   ! -newer compress.$$   -exec compress {} \;&lt;BR /&gt;&lt;BR /&gt;rm compress.$$&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 14 May 2002 13:00:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compressing-files/m-p/2722821#M945635</guid>
      <dc:creator>Bill Thorsteinson</dc:creator>
      <dc:date>2002-05-14T13:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: Compressing files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compressing-files/m-p/2722822#M945636</link>
      <description>&lt;BR /&gt;Well, I found a much safer solution that I tested and it works great.&lt;BR /&gt;&lt;BR /&gt;First the cron job gets a list of all the files to compress then I check each file against the v$archived_log table in oracle. &lt;BR /&gt;&lt;BR /&gt;If the file is properly archived and oracle is done with it, the Archiver process makes an entry into this table, making it safe to move or compress the file.&lt;BR /&gt;&lt;BR /&gt;I have tested this by issuing an "Alter system switch logfile" right after that I started watching the directory as the file makes to the archive directory and at the same time I query the V$Archived_log table for the existence of the file. The table never showed the file until oracle finished archiving then an entry popped up in the table.&lt;BR /&gt;&lt;BR /&gt;so the cron job never touches a file if it is not in the V$ARCHIVED_LOG table. If anyone is interested in the script, I will be glad to send it to them.&lt;BR /&gt;&lt;BR /&gt;By the way, to answer the other questions why not to give enough space. This database generates close to 50 Gb of archive logs a day.&lt;BR /&gt;The directory that holds all of this is 40 Gb. Compressing and sending the files to a stand by database database in another server and eventually to tape, is the best way to have space available for the next day.&lt;BR /&gt;&lt;BR /&gt;Again, many thanks to everyone who contributed their time and intellect to assist in solving this problem&lt;BR /&gt;&lt;BR /&gt;Thank you.</description>
      <pubDate>Tue, 14 May 2002 13:38:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compressing-files/m-p/2722822#M945636</guid>
      <dc:creator>Aziz Zouagui</dc:creator>
      <dc:date>2002-05-14T13:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: Compressing files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compressing-files/m-p/2722823#M945637</link>
      <description>Regardless of your process issues, you might want to replace the compress command with gzip: &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;itax_dev /tmp/algo # cp mail.log mail.log.preZ.txt&lt;BR /&gt;itax_dev /tmp/algo # cp mail.log mail.log.pregz.txt&lt;BR /&gt;itax_dev /tmp/algo # ls -arltp&lt;BR /&gt;total 7698&lt;BR /&gt;drwxrwxrwx  19 bin        bin           6144 May 15 09:07 ../&lt;BR /&gt;-r--r-----   1 ty         hpadmin    1310919 May 15 09:07 mail.log&lt;BR /&gt;-r--r-----   1 ty         hpadmin    1310919 May 15 09:07 mail.log.preZ.txt&lt;BR /&gt;drwxr-x---   2 ty         hpadmin         96 May 15 09:07 ./&lt;BR /&gt;-r--r-----   1 ty         hpadmin    1310919 May 15 09:07 mail.log.pregz.txt&lt;BR /&gt;itax_dev /tmp/algo # gzip mail.log.pregz.txt&lt;BR /&gt;itax_dev /tmp/algo # compress  mail.log.preZ.txt&lt;BR /&gt;itax_dev /tmp/algo # lt&lt;BR /&gt;total 3168&lt;BR /&gt;drwxrwxrwx  19 bin        bin           6144 May 15 09:07 ../&lt;BR /&gt;-r--r-----   1 ty         hpadmin    1310919 May 15 09:07 mail.log&lt;BR /&gt;-r--r-----   1 ty         hpadmin     203755 May 15 09:07 mail.log.preZ.txt.Z&lt;BR /&gt;-r--r-----   1 ty         hpadmin      98570 May 15 09:07 mail.log.pregz.txt.gz&lt;BR /&gt;drwxr-x---   2 ty         hpadmin       1024 May 15 09:08 ./&lt;BR /&gt;itax_dev /tmp/algo</description>
      <pubDate>Wed, 15 May 2002 12:08:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compressing-files/m-p/2722823#M945637</guid>
      <dc:creator>Thomas Yake</dc:creator>
      <dc:date>2002-05-15T12:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: Compressing files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compressing-files/m-p/2722824#M945638</link>
      <description>&lt;BR /&gt;Great info, you mean gzip compresses data much more than compress ?&lt;BR /&gt;&lt;BR /&gt;I didn't know that, I thought they are almost the same. But, clearly from your example, it looks like the gzip condensed more data than compress did. I will definitely have to switch from compress to gzip.&lt;BR /&gt;&lt;BR /&gt;Great input.</description>
      <pubDate>Wed, 15 May 2002 12:40:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compressing-files/m-p/2722824#M945638</guid>
      <dc:creator>Aziz Zouagui</dc:creator>
      <dc:date>2002-05-15T12:40:10Z</dc:date>
    </item>
  </channel>
</rss>

