<?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 Concurrent gzips in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/concurrent-gzips/m-p/2901547#M935975</link>
    <description>Hi&lt;BR /&gt;&lt;BR /&gt;I'm having difficulty developing a script which ought to be fairly simple I'd guess (if I knew what I was doing !!)&lt;BR /&gt;&lt;BR /&gt;Basically, currently we perform a disk backup of a database whch generates some huge files and then we do gzip * which only runs one instance of gzip and our box has 6 processors. We therefore have 5 idle'ish processors.&lt;BR /&gt;&lt;BR /&gt;What we want to do is have a script that runs after the disk backup has completed which runs 3 concurrent gzips until such time that all files have been compressed in a particular directory&lt;BR /&gt;I am hitting two issues though with my script !&lt;BR /&gt;&lt;BR /&gt;Firstly, because the files are so big, if 3 gzips are running, my script tries to pick up a file which is currently being compressed (because gzip creates a new file and leaves the old one there while it's compressing) and errors saying 'do you want to overwrite the .gz file'&lt;BR /&gt;&lt;BR /&gt;Because of this, I tried checking the status of the file using fuser filename | wc -w to ascertain whether the file was being used or not, but this doesn't seem to work either.&lt;BR /&gt;&lt;BR /&gt;I'm a bit stuck.&lt;BR /&gt;&lt;BR /&gt;Please can someone help&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Russell&lt;BR /&gt;</description>
    <pubDate>Tue, 11 Feb 2003 11:27:08 GMT</pubDate>
    <dc:creator>Russell Gould</dc:creator>
    <dc:date>2003-02-11T11:27:08Z</dc:date>
    <item>
      <title>Concurrent gzips</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/concurrent-gzips/m-p/2901547#M935975</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;I'm having difficulty developing a script which ought to be fairly simple I'd guess (if I knew what I was doing !!)&lt;BR /&gt;&lt;BR /&gt;Basically, currently we perform a disk backup of a database whch generates some huge files and then we do gzip * which only runs one instance of gzip and our box has 6 processors. We therefore have 5 idle'ish processors.&lt;BR /&gt;&lt;BR /&gt;What we want to do is have a script that runs after the disk backup has completed which runs 3 concurrent gzips until such time that all files have been compressed in a particular directory&lt;BR /&gt;I am hitting two issues though with my script !&lt;BR /&gt;&lt;BR /&gt;Firstly, because the files are so big, if 3 gzips are running, my script tries to pick up a file which is currently being compressed (because gzip creates a new file and leaves the old one there while it's compressing) and errors saying 'do you want to overwrite the .gz file'&lt;BR /&gt;&lt;BR /&gt;Because of this, I tried checking the status of the file using fuser filename | wc -w to ascertain whether the file was being used or not, but this doesn't seem to work either.&lt;BR /&gt;&lt;BR /&gt;I'm a bit stuck.&lt;BR /&gt;&lt;BR /&gt;Please can someone help&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Russell&lt;BR /&gt;</description>
      <pubDate>Tue, 11 Feb 2003 11:27:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/concurrent-gzips/m-p/2901547#M935975</guid>
      <dc:creator>Russell Gould</dc:creator>
      <dc:date>2003-02-11T11:27:08Z</dc:date>
    </item>
    <item>
      <title>Re: Concurrent gzips</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/concurrent-gzips/m-p/2901548#M935976</link>
      <description>Hi Russ:&lt;BR /&gt;&lt;BR /&gt;What if you first determined the files that you want to zip, then do the gzip:&lt;BR /&gt;&lt;BR /&gt;for i in `ls /source_dir/*.ext` &lt;BR /&gt;do&lt;BR /&gt; /usr/contrib/bin/gzip -c /source_dir/${i} &amp;gt; /dest_dir/${i}.gz&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Tom</description>
      <pubDate>Tue, 11 Feb 2003 11:54:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/concurrent-gzips/m-p/2901548#M935976</guid>
      <dc:creator>Tom Jackson</dc:creator>
      <dc:date>2003-02-11T11:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: Concurrent gzips</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/concurrent-gzips/m-p/2901549#M935977</link>
      <description>Hi!&lt;BR /&gt;As far as understand you could use&lt;BR /&gt;3 concurent gzip's and create different files&lt;BR /&gt;in your backup directory &lt;BACKUPDIR&gt;:&lt;BR /&gt;#gzip -c backupfile1 &amp;gt; /&lt;BACKUPDIR&gt;/bkp1.gz&lt;BR /&gt;#gzip -c backupfile2 &amp;gt; /&lt;BACKUPDIR&gt;/bkp2.gz&lt;BR /&gt;#gzip -c backupfile3 &amp;gt; /&lt;BACKUPDIR&gt;/bkp3.gz&lt;BR /&gt;&lt;BR /&gt; -c is used for redirect output of gzip-command&lt;BR /&gt;    to different files.&lt;BR /&gt;&lt;BR /&gt;If you wish, you can rename after that bkp*.gz&lt;BR /&gt;files with "mv".&lt;BR /&gt;&lt;BR /&gt;You can also increase the backup speed &lt;BR /&gt;using: "gzip -1 ...".&lt;BR /&gt;&lt;BR /&gt;Regards.&lt;BR /&gt;&lt;BR /&gt;&lt;/BACKUPDIR&gt;&lt;/BACKUPDIR&gt;&lt;/BACKUPDIR&gt;&lt;/BACKUPDIR&gt;</description>
      <pubDate>Tue, 11 Feb 2003 12:03:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/concurrent-gzips/m-p/2901549#M935977</guid>
      <dc:creator>Stanimir</dc:creator>
      <dc:date>2003-02-11T12:03:20Z</dc:date>
    </item>
    <item>
      <title>Re: Concurrent gzips</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/concurrent-gzips/m-p/2901550#M935978</link>
      <description>Hi Russell,&lt;BR /&gt;&lt;BR /&gt;This will do 3 at a time, picking up the next 3 when the 1st 3 have finished, etc...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;==========================&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;NUM=3&lt;BR /&gt;cd yourdirectory&lt;BR /&gt;files=`echo *`&lt;BR /&gt;echo $files&lt;BR /&gt;set -- $files&lt;BR /&gt;while test $# -gt 0 ; do&lt;BR /&gt;        for i in $1 $2 $3 ; do&lt;BR /&gt;         echo Zipping $i...&lt;BR /&gt;         gzip $i &amp;amp;&lt;BR /&gt;        done&lt;BR /&gt;        wait&lt;BR /&gt;        sleep 1&lt;BR /&gt;        if test $# -gt $NUM ; then&lt;BR /&gt;                shift $NUM&lt;BR /&gt;        else&lt;BR /&gt;                shift $#&lt;BR /&gt;        fi&lt;BR /&gt;done&lt;BR /&gt;=============================&lt;BR /&gt;&lt;BR /&gt;rgds, Robin</description>
      <pubDate>Tue, 11 Feb 2003 12:18:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/concurrent-gzips/m-p/2901550#M935978</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2003-02-11T12:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: Concurrent gzips</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/concurrent-gzips/m-p/2901551#M935979</link>
      <description>The trick to your dilemma is to run gzip in the background, so you can get multiple instances. &lt;BR /&gt;&lt;BR /&gt;If you do like this...&lt;BR /&gt;&lt;BR /&gt;for FILE in * ; do&lt;BR /&gt;gzip $FILE&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;The commands in the loop must finish before the loop continues.&lt;BR /&gt;&lt;BR /&gt;In unix, there is a nice way to tell your shell to run something background, which is indicated by ending the command with a "&amp;amp;" or ampersand character.&lt;BR /&gt;&lt;BR /&gt;for FILE in * ; do&lt;BR /&gt;gzip $FILE &amp;amp;&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Now, the first gzip will go to the background of the shell, and then the loop continues.  This of course will gzip everything in a directory, so use caution where/what you do this with.&lt;BR /&gt;&lt;BR /&gt;gzip is not multi-threaded, so you will not see a benefit of a multi-cpu machine on a single gzip.  I thought that a gnu-zip multithreaded version was in the works at some point, not sure the status though.  Check the gnu home page for updated information.&lt;BR /&gt;&lt;BR /&gt;Similarly, pkzip has a HP-UX (all unices for that matter) version which may be multi-threaded.  Again, check the pkware home page for better info.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Shannon</description>
      <pubDate>Tue, 11 Feb 2003 13:47:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/concurrent-gzips/m-p/2901551#M935979</guid>
      <dc:creator>Shannon Petry</dc:creator>
      <dc:date>2003-02-11T13:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: Concurrent gzips</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/concurrent-gzips/m-p/2901552#M935980</link>
      <description>try use fuser and make sure the file is not open when you pick up the file and try to gzip.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;fuser -f &lt;FILENAME&gt;&lt;BR /&gt;&lt;BR /&gt;filename: &lt;PID&gt;o&lt;BR /&gt;&lt;BR /&gt;the "o" above means the file is opened.&lt;/PID&gt;&lt;/FILENAME&gt;</description>
      <pubDate>Tue, 11 Feb 2003 22:14:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/concurrent-gzips/m-p/2901552#M935980</guid>
      <dc:creator>Wilfred Chau_1</dc:creator>
      <dc:date>2003-02-11T22:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: Concurrent gzips</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/concurrent-gzips/m-p/2901553#M935981</link>
      <description>You did mentioned that the files were big. If over 2 GB is size, the gzip utility provided with HPUX in not sufficient. Get the GNU gzip which will handle files over 2 GB in size.&lt;BR /&gt;&lt;BR /&gt;If not using largefiles for your filesystems, no worries.</description>
      <pubDate>Tue, 11 Feb 2003 22:26:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/concurrent-gzips/m-p/2901553#M935981</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2003-02-11T22:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: Concurrent gzips</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/concurrent-gzips/m-p/2901554#M935982</link>
      <description>Russell,&lt;BR /&gt;&lt;BR /&gt;Setting the jobs off in the background will be helpfull.&lt;BR /&gt;&lt;BR /&gt;All of the solutions shown pose a problem.  If all the backup are on the same disk.  Concurrency might not buy you as much as you like because of disk I/O contention.  You didn't mention  your DATABASE type and backup method.&lt;BR /&gt;&lt;BR /&gt;if your are using cpio you could try something like &lt;BR /&gt;(cd /database/data&lt;BR /&gt;find . -print |cpio -o |gzip &amp;gt; /archive/data.out.) &amp;amp;&lt;BR /&gt;for each file system. contention rules still apply.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;If you backup directily to a tape drive, On most systems compression is implied. Compressing a backup file and then putting it to tape would not buy you anything but overhead.&lt;BR /&gt;&lt;BR /&gt;Don't forget that you can exceed bus bandwidth when backuping up to multiple tape drives. Hardware layout and design is important.&lt;BR /&gt;&lt;BR /&gt;If your are doing dbexport from oracle.  You can do the following:&lt;BR /&gt;mknod /dev/oracle_pipe p&lt;BR /&gt;exp scott/tiger buffer=1000000 file=/dev/oracle_pipe full=y grants=y log=/tmp/oracle_dmp.log&lt;BR /&gt; | gzip &amp;lt; /dev/oracle_pipe &amp;gt; /archive/oracle_dmp.gz &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Rory&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 12 Feb 2003 18:47:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/concurrent-gzips/m-p/2901554#M935982</guid>
      <dc:creator>Rory R Hammond</dc:creator>
      <dc:date>2003-02-12T18:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: Concurrent gzips</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/concurrent-gzips/m-p/2901555#M935983</link>
      <description>Russel,&lt;BR /&gt;&lt;BR /&gt; We use "compress" to shrink our  oracle backup .dbf files. Since all instances' .dbf files are backed up to the same filesystem, we do the compress immediately after the .dbf files are created for each instance. Our goal is not to fill up the backup filesystem (or make it larger than it needs to be). I changed our backup script to also do a full export of every instance on the host and then compress the export file. Our backup strategy consists of 1) a cold backup (weekly) and 2) hot backups (daily) that copy the native .dbf files to the backup filesystem. Databases are shut down for(and restarted after) the weekly cold backup. &lt;BR /&gt;  Jack</description>
      <pubDate>Wed, 12 Feb 2003 21:37:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/concurrent-gzips/m-p/2901555#M935983</guid>
      <dc:creator>Jack Werner</dc:creator>
      <dc:date>2003-02-12T21:37:20Z</dc:date>
    </item>
  </channel>
</rss>

