<?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: Problems with a script that cycles log files in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/problems-with-a-script-that-cycles-log-files/m-p/2562294#M919019</link>
    <description>If you just want to "cycle" every file you find in your logs directory, why do you have to cd in every single directory.&lt;BR /&gt;&lt;BR /&gt;What you do is to  go down every directory under your starting point. Then you cycle every file you find.&lt;BR /&gt;&lt;BR /&gt;I would think it is easier to just stay where you are and cycle every file from there. Like&lt;BR /&gt;&lt;BR /&gt;cd $1 &lt;BR /&gt;find . -type f | while read line &lt;BR /&gt;do &lt;BR /&gt;cycle $line 2 # or what ever you want&lt;BR /&gt;done &lt;BR /&gt;&lt;BR /&gt;Hope this helps&lt;BR /&gt;&lt;BR /&gt;Regards Stefan&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;BTW: Your profile says: "This member has assigned points to 28 of 78 responses to his/her questions." Please assign points as they help others to find the best solution that was provided.</description>
    <pubDate>Wed, 08 Aug 2001 04:38:43 GMT</pubDate>
    <dc:creator>Stefan Schulz</dc:creator>
    <dc:date>2001-08-08T04:38:43Z</dc:date>
    <item>
      <title>Problems with a script that cycles log files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problems-with-a-script-that-cycles-log-files/m-p/2562290#M919015</link>
      <description>Greetings having a problem with a script that is used to cycle log files.  We have a directory /wv/dvlp/rms/log.  Under the log directories we have several directories for example /wv/dvlp/rms/log/dira, dirb, etc.  Under /wv/dvlp/rms/log/dira there maybe a directory and underneath that directory there maybe another directory.  With the script I have I can cycle the log files in the /wv/dvlp/rms/log/dira directory but cannot cycle the log files that are in directories below /wv/dvlp/rms/log/dira. Here is the script:&lt;BR /&gt;cd $1 &lt;BR /&gt; for i in `ls -l |grep "^d"| tr -s " " " "|cut -d" " -f9`&lt;BR /&gt; do&lt;BR /&gt;   cd $i&lt;BR /&gt;        for x in `ls -l -R |grep "^d"| tr -s " " " "|cut -d" " -f9`&lt;BR /&gt;       do&lt;BR /&gt;         echo $x&lt;BR /&gt;         cd $x&lt;BR /&gt;            for l in `ls`&lt;BR /&gt;              do&lt;BR /&gt;               cycle $l 2 &lt;BR /&gt;              done&lt;BR /&gt;        cd ..&lt;BR /&gt;        cd $x &lt;BR /&gt;         echo "In sub dir"&lt;BR /&gt;       done&lt;BR /&gt;cd ..&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Any help would be greatly appreciated.  Please don't limit your responses to fixing my script I'm sure someone out there has a better way of accomplishing this task.   Again thankyou for your response.&lt;BR /&gt;&lt;BR /&gt;--Norm Long--&lt;BR /&gt;--World Vision--</description>
      <pubDate>Mon, 06 Aug 2001 19:14:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problems-with-a-script-that-cycles-log-files/m-p/2562290#M919015</guid>
      <dc:creator>wvsa</dc:creator>
      <dc:date>2001-08-06T19:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with a script that cycles log files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problems-with-a-script-that-cycles-log-files/m-p/2562291#M919016</link>
      <description>I would use the find command.&lt;BR /&gt;&lt;BR /&gt;cd $1&lt;BR /&gt;find ./ -type d | while read line&lt;BR /&gt;do&lt;BR /&gt;cd $line&lt;BR /&gt;whatever you want&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;...jcd...</description>
      <pubDate>Mon, 06 Aug 2001 19:22:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problems-with-a-script-that-cycles-log-files/m-p/2562291#M919016</guid>
      <dc:creator>Joseph C. Denman</dc:creator>
      <dc:date>2001-08-06T19:22:10Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with a script that cycles log files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problems-with-a-script-that-cycles-log-files/m-p/2562292#M919017</link>
      <description>Whooops, that wont work.&lt;BR /&gt;&lt;BR /&gt;Howabout something like this:&lt;BR /&gt;&lt;BR /&gt;home=/where/you/want/to/start&lt;BR /&gt;find $home -type d | while read line &lt;BR /&gt;do&lt;BR /&gt;cd $line &lt;BR /&gt;#cycle your stuff &lt;BR /&gt;done &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 06 Aug 2001 19:30:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problems-with-a-script-that-cycles-log-files/m-p/2562292#M919017</guid>
      <dc:creator>Joseph C. Denman</dc:creator>
      <dc:date>2001-08-06T19:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with a script that cycles log files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problems-with-a-script-that-cycles-log-files/m-p/2562293#M919018</link>
      <description>I have attached a script that clears out log and compresses log files. I have modified it to clear out some other logs as well as system logs. Maybe you can take the basic concept of it and rewrite it a little to help you do what you need.&lt;BR /&gt;Hope it helps Richard&lt;BR /&gt;&lt;BR /&gt;Richard</description>
      <pubDate>Mon, 06 Aug 2001 19:54:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problems-with-a-script-that-cycles-log-files/m-p/2562293#M919018</guid>
      <dc:creator>someone_4</dc:creator>
      <dc:date>2001-08-06T19:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with a script that cycles log files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problems-with-a-script-that-cycles-log-files/m-p/2562294#M919019</link>
      <description>If you just want to "cycle" every file you find in your logs directory, why do you have to cd in every single directory.&lt;BR /&gt;&lt;BR /&gt;What you do is to  go down every directory under your starting point. Then you cycle every file you find.&lt;BR /&gt;&lt;BR /&gt;I would think it is easier to just stay where you are and cycle every file from there. Like&lt;BR /&gt;&lt;BR /&gt;cd $1 &lt;BR /&gt;find . -type f | while read line &lt;BR /&gt;do &lt;BR /&gt;cycle $line 2 # or what ever you want&lt;BR /&gt;done &lt;BR /&gt;&lt;BR /&gt;Hope this helps&lt;BR /&gt;&lt;BR /&gt;Regards Stefan&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;BTW: Your profile says: "This member has assigned points to 28 of 78 responses to his/her questions." Please assign points as they help others to find the best solution that was provided.</description>
      <pubDate>Wed, 08 Aug 2001 04:38:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problems-with-a-script-that-cycles-log-files/m-p/2562294#M919019</guid>
      <dc:creator>Stefan Schulz</dc:creator>
      <dc:date>2001-08-08T04:38:43Z</dc:date>
    </item>
  </channel>
</rss>

