<?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: find command with gzip in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-gzip/m-p/3106828#M148010</link>
    <description>Kevin -&lt;BR /&gt;Yeah I'm leaning #2, just wondered if it could be quantified. Not interested in trying another way, since this is nearly identical to the man page example using -exec rm, just looking for a "why not this?".&lt;BR /&gt;&lt;BR /&gt;There was a typo in the command I presented it is precisely:&lt;BR /&gt;find /path_to/some_directory \( -mtime +30 -a ! -name '*.gz' \) -exec /usr/contrib/bin/gzip {}  \;&lt;BR /&gt;&lt;BR /&gt;John &amp;amp; Pete-&lt;BR /&gt;Not a blip in glance when I ran the command, not even close to limits.&lt;BR /&gt;&lt;BR /&gt;Todd -&lt;BR /&gt;Sorry, not relevent to the post.&lt;BR /&gt;&lt;BR /&gt;Still frustrated.&lt;BR /&gt;&lt;BR /&gt;dl</description>
    <pubDate>Thu, 30 Oct 2003 15:00:50 GMT</pubDate>
    <dc:creator>Dave La Mar</dc:creator>
    <dc:date>2003-10-30T15:00:50Z</dc:date>
    <item>
      <title>find command with gzip</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-gzip/m-p/3106823#M148005</link>
      <description>The below command, whether from a script or command line fails to zip all the eligible files found.          &lt;BR /&gt;                                                                                                             &lt;BR /&gt;find /path_to/some_directory -mtime +30 -a ! -name "*.gz" -exec /usr/contrib/bin/gzip {}  \;                 &lt;BR /&gt;                                                                                                             &lt;BR /&gt;To set the tone for my post:                                                                                 &lt;BR /&gt;1. I do not need an option to what the above is expected to perform.                                    &lt;BR /&gt;2. I realize there are a host of other ways to produce the results the command is "supposed" to perform.&lt;BR /&gt;3. I am utilizing another solution.                                                                     &lt;BR /&gt;                                                                                                             &lt;BR /&gt;With the above in mind, my post is simply:                                                                   &lt;BR /&gt;                                                                                                             &lt;BR /&gt;1. Why would one need to run the posted command multiple times to get all eligible files zipped?        &lt;BR /&gt;2. It appears to be similar to a buffer overrun where the find command produces results faster          &lt;BR /&gt; than gzip can perform.                                                                               &lt;BR /&gt;                                                                                                      &lt;BR /&gt;Has anyone a "qualified" explanation for this issue?                                                         &lt;BR /&gt;                                                                                                             &lt;BR /&gt;Thanks in advance for that "explanation".                                                                    &lt;BR /&gt;                                                                                                             &lt;BR /&gt;Best regards,                                                                                                &lt;BR /&gt;                                                                                                             &lt;BR /&gt;dl                                                                                                           &lt;BR /&gt;</description>
      <pubDate>Thu, 30 Oct 2003 13:53:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-gzip/m-p/3106823#M148005</guid>
      <dc:creator>Dave La Mar</dc:creator>
      <dc:date>2003-10-30T13:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: find command with gzip</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-gzip/m-p/3106824#M148006</link>
      <description>2) It appears to be similar to a buffer overrun where the find command produces results faster than gzip can perform. &lt;BR /&gt;&lt;BR /&gt;I would agree with this..does the command work using xargs?&lt;BR /&gt;</description>
      <pubDate>Thu, 30 Oct 2003 13:59:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-gzip/m-p/3106824#M148006</guid>
      <dc:creator>Kevin Wright</dc:creator>
      <dc:date>2003-10-30T13:59:42Z</dc:date>
    </item>
    <item>
      <title>Re: find command with gzip</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-gzip/m-p/3106825#M148007</link>
      <description>I wonder if your assumption #2 isn't correct. From the man page:&lt;BR /&gt;&lt;BR /&gt;  find pathname -type d -print | xargs chmod 555&lt;BR /&gt;&lt;BR /&gt;           Note that output from find was piped to xargs(1) instead of using&lt;BR /&gt;           the -exec primary.  This is because when a large number of files&lt;BR /&gt;           or directories is to be processed by a single command, the -exec&lt;BR /&gt;           primary spawns a separate process for each file or directory,&lt;BR /&gt;           whereas xargs collects file names or directory names into&lt;BR /&gt;           multiple arguments to a single chmod command, resulting in fewer&lt;BR /&gt;           processes and greater system efficiency. The + delimiter for the&lt;BR /&gt;           -exec primary can be used to achieve the same efficiency.&lt;BR /&gt;&lt;BR /&gt;Since it is doing all of this forking, I wonder if you are exceeding you max_procs.</description>
      <pubDate>Thu, 30 Oct 2003 14:16:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-gzip/m-p/3106825#M148007</guid>
      <dc:creator>John Dvorchak</dc:creator>
      <dc:date>2003-10-30T14:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: find command with gzip</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-gzip/m-p/3106826#M148008</link>
      <description>Dave,&lt;BR /&gt;&lt;BR /&gt;I really like John's thinking here and I think you could easily prove his case by observing Glance's System Tables Report while running your find command.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 30 Oct 2003 14:28:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-gzip/m-p/3106826#M148008</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2003-10-30T14:28:20Z</dc:date>
    </item>
    <item>
      <title>Re: find command with gzip</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-gzip/m-p/3106827#M148009</link>
      <description>Im kind of wondering if it would be better in a script that first identifies the files then performs the zip in a for loop.&lt;BR /&gt;&lt;BR /&gt;find .. ... -mtime +30 -a !name &amp;gt; file.list&lt;BR /&gt;for name in `cat file.list`&lt;BR /&gt;do&lt;BR /&gt;/usr/contrib/bin/gzip $name&lt;BR /&gt;echo "$name is zipped, proceeding to next file."&lt;BR /&gt;done &lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;cant remember if single or double quotes work... I think it is double with a Variable name...&lt;BR /&gt;</description>
      <pubDate>Thu, 30 Oct 2003 14:35:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-gzip/m-p/3106827#M148009</guid>
      <dc:creator>Todd McDaniel_1</dc:creator>
      <dc:date>2003-10-30T14:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: find command with gzip</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-gzip/m-p/3106828#M148010</link>
      <description>Kevin -&lt;BR /&gt;Yeah I'm leaning #2, just wondered if it could be quantified. Not interested in trying another way, since this is nearly identical to the man page example using -exec rm, just looking for a "why not this?".&lt;BR /&gt;&lt;BR /&gt;There was a typo in the command I presented it is precisely:&lt;BR /&gt;find /path_to/some_directory \( -mtime +30 -a ! -name '*.gz' \) -exec /usr/contrib/bin/gzip {}  \;&lt;BR /&gt;&lt;BR /&gt;John &amp;amp; Pete-&lt;BR /&gt;Not a blip in glance when I ran the command, not even close to limits.&lt;BR /&gt;&lt;BR /&gt;Todd -&lt;BR /&gt;Sorry, not relevent to the post.&lt;BR /&gt;&lt;BR /&gt;Still frustrated.&lt;BR /&gt;&lt;BR /&gt;dl</description>
      <pubDate>Thu, 30 Oct 2003 15:00:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-gzip/m-p/3106828#M148010</guid>
      <dc:creator>Dave La Mar</dc:creator>
      <dc:date>2003-10-30T15:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: find command with gzip</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-gzip/m-p/3106829#M148011</link>
      <description>No, disrespect... but I think my example is very relevant. &lt;BR /&gt; &lt;BR /&gt;I can understand you wanting to do it as the manpage shows, but how can you say my example is irrelevant?&lt;BR /&gt; &lt;BR /&gt;The problem with the gzip command is that you have a variable amount of time for the Gzip to finish...&lt;BR /&gt; &lt;BR /&gt;The find command is forcing its output into the gzip command which can only handle 1 file at a time.  Using exec rm is totally different unless the file is extremely large. rm will almost immediately remove a file with little or no overflow... whereas gzip will take much longer in comparison.&lt;BR /&gt; &lt;BR /&gt;You must find a way to hold off the data flow from the find command and allow the gzip to complete its work. My example does that... unless it has a syntax error.&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;</description>
      <pubDate>Thu, 30 Oct 2003 15:11:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-gzip/m-p/3106829#M148011</guid>
      <dc:creator>Todd McDaniel_1</dc:creator>
      <dc:date>2003-10-30T15:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: find command with gzip</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-gzip/m-p/3106830#M148012</link>
      <description>Todd -&lt;BR /&gt;Whoa, certainly no disrespect intended on my part either. While your second post is more to the relevance of the content of the post, I am really looking to find "the why answer", and yours is a fair conclusion.&lt;BR /&gt;And I thank you.&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;&lt;BR /&gt;dl&lt;BR /&gt;&amp;gt;snip&lt;BR /&gt;&lt;BR /&gt;To set the tone for my post:                                                                             &lt;BR /&gt;1. I do not need an option to what the above is expected to perform.                                     &lt;BR /&gt;2. I realize there are a host of other ways to produce the results the command is "supposed" to perform. &lt;BR /&gt;3. I am utilizing another solution.                                                                      &lt;BR /&gt;                                                                                                         &lt;BR /&gt;With the above in mind, my post is simply:                                                               &lt;BR /&gt;                                                                                                         &lt;BR /&gt;1. Why would one need to run the posted command multiple times to get all eligible files zipped?         &lt;BR /&gt;2. It appears to be similar to a buffer overrun where the find command produces results faster           &lt;BR /&gt;than gzip can perform.                                                                                   &lt;BR /&gt;                                                                                                         &lt;BR /&gt;Has anyone a "qualified" explanation for this issue?                                                     &lt;BR /&gt;</description>
      <pubDate>Thu, 30 Oct 2003 15:18:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-gzip/m-p/3106830#M148012</guid>
      <dc:creator>Dave La Mar</dc:creator>
      <dc:date>2003-10-30T15:18:49Z</dc:date>
    </item>
    <item>
      <title>Re: find command with gzip</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-gzip/m-p/3106831#M148013</link>
      <description>Something else to keep in mind regarding find with the -mtime option, is that the search is not only dependent on the date, but on the time.  If you have files in this directory that are being created all time, seconds or minutes apart, then you could very well get different results everytime you run the command.&lt;BR /&gt;&lt;BR /&gt;You could have a file there that was created 29 days 23 hours 55 minutes and 16 seconds ago, that won't get picked up the first time you run the command, but if you wait 5 minutes, then it will since it is then more than 30 days old.</description>
      <pubDate>Thu, 30 Oct 2003 15:22:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-gzip/m-p/3106831#M148013</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2003-10-30T15:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: find command with gzip</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-gzip/m-p/3106832#M148014</link>
      <description>Patrick -&lt;BR /&gt;Good point. One that I did not consider, but after testing I find this is not the case.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;dl</description>
      <pubDate>Thu, 30 Oct 2003 15:24:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-gzip/m-p/3106832#M148014</guid>
      <dc:creator>Dave La Mar</dc:creator>
      <dc:date>2003-10-30T15:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: find command with gzip</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-gzip/m-p/3106833#M148015</link>
      <description>Dave,&lt;BR /&gt; &lt;BR /&gt;hehe...everyting is cool. &lt;BR /&gt; &lt;BR /&gt;just trying to keep an even keel here. I know I can come accross rather strong sometimes in text only when you cant see my true intent.&lt;BR /&gt; &lt;BR /&gt;I understand trying to solve "why". I am very much like that as well... Even if I found another answer that worked, I would still like to know why it cant work if it doesn't.&lt;BR /&gt; &lt;BR /&gt;keep plugging away and post your solution if you find one that will work with "find".</description>
      <pubDate>Thu, 30 Oct 2003 15:38:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-gzip/m-p/3106833#M148015</guid>
      <dc:creator>Todd McDaniel_1</dc:creator>
      <dc:date>2003-10-30T15:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: find command with gzip</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-gzip/m-p/3106834#M148016</link>
      <description>Ok let me try another stab at this. I am still thinking that you are running into a limit here so could you test it again and monitor these kernel params:&lt;BR /&gt;&lt;BR /&gt;max_thread_proc&lt;BR /&gt;&lt;BR /&gt;maxuprc&lt;BR /&gt;&lt;BR /&gt;I got this from running sam and looking at HELP:&lt;BR /&gt;&lt;BR /&gt; * Overview of Process Management Parameters                                   * Configurable Parameters for Process Management:                                  maxdsiz         maximum process data segment size  &lt;BR /&gt;                &lt;BR /&gt;maxssiz         maximum process storage segment size                      &lt;BR /&gt;&lt;BR /&gt;max_thread_proc maximum number of threads that one process can create                                       &lt;BR /&gt;&lt;BR /&gt;maxtsiz         maximum process text segment size                 &lt;BR /&gt;&lt;BR /&gt;maxuprc         maximum number of processes per user&lt;BR /&gt;&lt;BR /&gt;nkthread        maximum number of kernel threads allowed on the system at same time</description>
      <pubDate>Thu, 30 Oct 2003 15:52:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-gzip/m-p/3106834#M148016</guid>
      <dc:creator>John Dvorchak</dc:creator>
      <dc:date>2003-10-30T15:52:53Z</dc:date>
    </item>
    <item>
      <title>Re: find command with gzip</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-gzip/m-p/3106835#M148017</link>
      <description>John -&lt;BR /&gt;Looks like:&lt;BR /&gt;max_thread_proc 256  &lt;BR /&gt;                     &lt;BR /&gt;maxuprc - 2500       &lt;BR /&gt;                     &lt;BR /&gt;maxssiz maximum - 2gb&lt;BR /&gt;                     &lt;BR /&gt;maxtsiz - 10gb       &lt;BR /&gt;                     &lt;BR /&gt;nkthread - 2048      &lt;BR /&gt; I am looking for the metric for max_thread_proc in order to run glance -adviser  only for this while the script is running. The reason why I suspect you may have found the reason is the value of 256.&lt;BR /&gt;Note though that of the 1036 files available for zipping, the last run only zipped 162. Do you really think a new thread is created on each file passed to the gzip. If so, I think we are gaining ground on this.&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;&lt;BR /&gt;dl</description>
      <pubDate>Thu, 30 Oct 2003 16:48:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-gzip/m-p/3106835#M148017</guid>
      <dc:creator>Dave La Mar</dc:creator>
      <dc:date>2003-10-30T16:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: find command with gzip</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-gzip/m-p/3106836#M148018</link>
      <description>find -exec is inefficient because it forks a process for each match, BUT does it actually run the processes in parallel???  It seems quite likely that find would fork, exec, then wait for the child to complete before continuing.  If this is the case, then maxuprc wouldn't come into it - only find and one gzip are running at any one time.  However, as gzip modifies the directory which is being processed by find - find is probably doing a readdir() - is it possible that the updates to the directory are interfering with the results of readdir?</description>
      <pubDate>Thu, 30 Oct 2003 16:53:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-gzip/m-p/3106836#M148018</guid>
      <dc:creator>Alan Turner</dc:creator>
      <dc:date>2003-10-30T16:53:03Z</dc:date>
    </item>
    <item>
      <title>Re: find command with gzip</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-gzip/m-p/3106837#M148019</link>
      <description>Alan -&lt;BR /&gt;Good thought, but the update would be the zipped file which is in the -a part of the logic to ignore .gz files. Or were you on another train of thought?&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;dl&lt;BR /&gt;</description>
      <pubDate>Thu, 30 Oct 2003 16:59:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-gzip/m-p/3106837#M148019</guid>
      <dc:creator>Dave La Mar</dc:creator>
      <dc:date>2003-10-30T16:59:27Z</dc:date>
    </item>
    <item>
      <title>Re: find command with gzip</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-gzip/m-p/3106838#M148020</link>
      <description>John D. -&lt;BR /&gt;O.K. I ran glance in systax_only against&lt;BR /&gt; proc_thread_count,proc_proc_id to cover the period of time the command was running.&lt;BR /&gt;Unfortunately, it came back indicating only one thread for the process at any given time it was running.&lt;BR /&gt;Sure was worth a try. &lt;BR /&gt;Thanks. &lt;BR /&gt;&lt;BR /&gt;Any other ideas?&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;dl</description>
      <pubDate>Thu, 30 Oct 2003 19:38:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-gzip/m-p/3106838#M148020</guid>
      <dc:creator>Dave La Mar</dc:creator>
      <dc:date>2003-10-30T19:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: find command with gzip</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-gzip/m-p/3106839#M148021</link>
      <description>Dave&lt;BR /&gt;&lt;BR /&gt;I was on a rather different train of thought:&lt;BR /&gt;a) find appears to do its execs one at a time (hence no obvious huge number of threads or processes)&lt;BR /&gt;b) since there are a lot of files to handle, find will exec several times&lt;BR /&gt;c) each command exec'd modifies the directory being searched (to create &lt;FILE&gt;.gz and delete &lt;FILE&gt;)&lt;BR /&gt;d) find is probably using the readdir() call to get the directory contents - will this cope gracefully with the directory being changed on every call?  Perhaps the filesystem code every so often reorganises the directory to eliminate holes, e.g. by moving late entries to earlier positions, in which case a file entry could be moved from beyond the current directory pointer (held locally by find) to be before the directory pointer, and thus be missed.&lt;BR /&gt;&lt;BR /&gt;(BTW - I would have expected a "-type f" on the find, but I don't think it's relevant.)&lt;/FILE&gt;&lt;/FILE&gt;</description>
      <pubDate>Fri, 31 Oct 2003 03:50:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-gzip/m-p/3106839#M148021</guid>
      <dc:creator>Alan Turner</dc:creator>
      <dc:date>2003-10-31T03:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: find command with gzip</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-gzip/m-p/3106840#M148022</link>
      <description>Alan -&lt;BR /&gt;Thanks for the well explained possibility.&lt;BR /&gt;I sure hate closing out this thread without a definitive answer.&lt;BR /&gt;There has been good participation and alot of thought given by all who replied.&lt;BR /&gt;While I lean towards a couple of the replies, I will walk away with another unsolved mystery. At this point, I have wasted enough time of the talented forum participants as well as our own staff on this topic.&lt;BR /&gt;&lt;BR /&gt;I apolgize to all for not awarding higher than a 7, but I would not want this thread referred to in the future with the expectation of a solution.&lt;BR /&gt;&lt;BR /&gt;Many thanks to all.&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;&lt;BR /&gt;dl</description>
      <pubDate>Fri, 31 Oct 2003 14:02:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-with-gzip/m-p/3106840#M148022</guid>
      <dc:creator>Dave La Mar</dc:creator>
      <dc:date>2003-10-31T14:02:16Z</dc:date>
    </item>
  </channel>
</rss>

