<?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: Shell scripts help - find deletes the base dir. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts-help-find-deletes-the-base-dir/m-p/3801811#M266697</link>
    <description>Or the simplest:&lt;BR /&gt; &lt;BR /&gt;find ${dir1}/* ...rest of options...&lt;BR /&gt; &lt;BR /&gt;${dir1}/* is replaced with a list of all the items in $dir1 but not the directory itself.</description>
    <pubDate>Wed, 07 Jun 2006 16:00:44 GMT</pubDate>
    <dc:creator>Bill Hassell</dc:creator>
    <dc:date>2006-06-07T16:00:44Z</dc:date>
    <item>
      <title>Shell scripts help - find deletes the base dir.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts-help-find-deletes-the-base-dir/m-p/3801803#M266689</link>
      <description>My following scripts works but also removes the base directory â  log_outputâ   which I don't want to remove.  How to rectify this script so it should not delete the log_output directory.&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;nod=60&lt;BR /&gt;dir1=/psoft/prcs/log_output&lt;BR /&gt;&lt;BR /&gt;find $dir1 -mtime +$nod -name "_PSDSTSRVLOG" -prune -o -name "_PSPRCSRVLOG" -prune -o -name "_TUXLOG" -prune -o -print | tee /psoft/log_fstrn8.txt | xargs rm -rf&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Gulam.</description>
      <pubDate>Wed, 07 Jun 2006 12:00:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts-help-find-deletes-the-base-dir/m-p/3801803#M266689</guid>
      <dc:creator>Gulam Mohiuddin</dc:creator>
      <dc:date>2006-06-07T12:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: Shell scripts help - find deletes the base dir.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts-help-find-deletes-the-base-dir/m-p/3801804#M266690</link>
      <description>Are you just wanting to delete regular files?  If so, just add a '-type f' to your find to search only files.</description>
      <pubDate>Wed, 07 Jun 2006 12:02:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts-help-find-deletes-the-base-dir/m-p/3801804#M266690</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2006-06-07T12:02:23Z</dc:date>
    </item>
    <item>
      <title>Re: Shell scripts help - find deletes the base dir.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts-help-find-deletes-the-base-dir/m-p/3801805#M266691</link>
      <description>No, there are lots of other subdir which I would also like to remove.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Gulam.</description>
      <pubDate>Wed, 07 Jun 2006 12:05:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts-help-find-deletes-the-base-dir/m-p/3801805#M266691</guid>
      <dc:creator>Gulam Mohiuddin</dc:creator>
      <dc:date>2006-06-07T12:05:32Z</dc:date>
    </item>
    <item>
      <title>Re: Shell scripts help - find deletes the base dir.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts-help-find-deletes-the-base-dir/m-p/3801806#M266692</link>
      <description>i dont know how to help you, but i think, why dont you create that directory at the end of the script?</description>
      <pubDate>Wed, 07 Jun 2006 12:11:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts-help-find-deletes-the-base-dir/m-p/3801806#M266692</guid>
      <dc:creator>inventsekar_1</dc:creator>
      <dc:date>2006-06-07T12:11:05Z</dc:date>
    </item>
    <item>
      <title>Re: Shell scripts help - find deletes the base dir.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts-help-find-deletes-the-base-dir/m-p/3801807#M266693</link>
      <description>Use a /. after the $dir1&lt;BR /&gt;&lt;BR /&gt;find $dir1/. -mtime ..........&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;you will get an error stating rm: cannot remove .. or ., but all below $dir will be gone.&lt;BR /&gt;&lt;BR /&gt;...jcd...</description>
      <pubDate>Wed, 07 Jun 2006 12:13:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts-help-find-deletes-the-base-dir/m-p/3801807#M266693</guid>
      <dc:creator>Joseph C. Denman</dc:creator>
      <dc:date>2006-06-07T12:13:47Z</dc:date>
    </item>
    <item>
      <title>Re: Shell scripts help - find deletes the base dir.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts-help-find-deletes-the-base-dir/m-p/3801808#M266694</link>
      <description>Hi Gulam,&lt;BR /&gt;&lt;BR /&gt;you can explicitly skip it:&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;find $dir1 -mtime +$nod -name "_PSDSTSRVLOG" -prune -o -name "_PSPRCSRVLOG" -prune -o -name "_TUXLOG" -prune -o -print | tee /psoft/log_fstrn8.txt |&lt;BR /&gt; fgrep -vx $dir1 | xargs rm -rf&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Wed, 07 Jun 2006 12:33:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts-help-find-deletes-the-base-dir/m-p/3801808#M266694</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2006-06-07T12:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: Shell scripts help - find deletes the base dir.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts-help-find-deletes-the-base-dir/m-p/3801809#M266695</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;If I changed it to $dir/. then it deltes all files/subdir under log_output just keepling following two pruned subdir &lt;BR /&gt;&lt;BR /&gt;total 108&lt;BR /&gt;drwxr-x---   2 fstrn8     psoft        39936 Jun  7 05:22 _PSDSTSRVLOG&lt;BR /&gt;drwxr-x---   2 fstrn8     psoft        15360 Jun  7 12:34 _PSPRCSRVLOG&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Gulam.</description>
      <pubDate>Wed, 07 Jun 2006 12:33:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts-help-find-deletes-the-base-dir/m-p/3801809#M266695</guid>
      <dc:creator>Gulam Mohiuddin</dc:creator>
      <dc:date>2006-06-07T12:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: Shell scripts help - find deletes the base dir.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts-help-find-deletes-the-base-dir/m-p/3801810#M266696</link>
      <description>... or, you can&lt;BR /&gt;&lt;BR /&gt;cd $dir1&lt;BR /&gt;&lt;BR /&gt;find . -mtime +$nod -name "_PSDSTSRVLOG" -prune -o -name "_PSPRCSRVLOG" -prune -o -name "_TUXLOG" -prune -o -print | tee /psoft/log_fstrn8.txt | xargs rm -rf&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Jun 2006 12:51:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts-help-find-deletes-the-base-dir/m-p/3801810#M266696</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2006-06-07T12:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: Shell scripts help - find deletes the base dir.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts-help-find-deletes-the-base-dir/m-p/3801811#M266697</link>
      <description>Or the simplest:&lt;BR /&gt; &lt;BR /&gt;find ${dir1}/* ...rest of options...&lt;BR /&gt; &lt;BR /&gt;${dir1}/* is replaced with a list of all the items in $dir1 but not the directory itself.</description>
      <pubDate>Wed, 07 Jun 2006 16:00:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts-help-find-deletes-the-base-dir/m-p/3801811#M266697</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2006-06-07T16:00:44Z</dc:date>
    </item>
    <item>
      <title>Re: Shell scripts help - find deletes the base dir.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts-help-find-deletes-the-base-dir/m-p/3801812#M266698</link>
      <description>Gulam,&lt;BR /&gt;do a 'touch $dir1' before you start.</description>
      <pubDate>Thu, 08 Jun 2006 02:00:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-scripts-help-find-deletes-the-base-dir/m-p/3801812#M266698</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2006-06-08T02:00:14Z</dc:date>
    </item>
  </channel>
</rss>

