<?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: Filesystem Maintenance script help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/filesystem-maintenance-script-help/m-p/2865619#M97149</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I may be too stupid to understand what you mean, but...&lt;BR /&gt;&lt;BR /&gt;you've got it already! ;-)&lt;BR /&gt;&lt;BR /&gt;find /pfxarchive -size +10000000c -exec rm {} \;&lt;BR /&gt;&lt;BR /&gt;and &lt;BR /&gt;find /psnarchive -size +10000000c -exec rm {} \;&lt;BR /&gt;&lt;BR /&gt;will remove automatically the files...&lt;BR /&gt;&lt;BR /&gt;of course, if you've aliased rm to rm -i, may have to unalias it: &lt;BR /&gt;unalias rm&lt;BR /&gt;&lt;BR /&gt;you could also use rm -f instead of rm, but that's a _bad_ idea if you're running the script as root ;-P&lt;BR /&gt;Cheers,&lt;BR /&gt;&lt;BR /&gt;FiX</description>
    <pubDate>Tue, 17 Dec 2002 12:02:42 GMT</pubDate>
    <dc:creator>F. X. de Montgolfier</dc:creator>
    <dc:date>2002-12-17T12:02:42Z</dc:date>
    <item>
      <title>Filesystem Maintenance script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/filesystem-maintenance-script-help/m-p/2865617#M97147</link>
      <description>Hi peeps.&lt;BR /&gt;&lt;BR /&gt;One of my many shortcomings in wanting to be a 'proper' sysadmin is that i cant script for toffee...in other words i need some help.&lt;BR /&gt;&lt;BR /&gt;Problem.&lt;BR /&gt;&lt;BR /&gt;I have 2 archive filesystems that i have to clear down after i have backed them up,&lt;BR /&gt;/psnarchive and /pfx archive. &lt;BR /&gt;I use the following commands to list the large files within the filesystems ans sub directories&lt;BR /&gt;&lt;BR /&gt;find /pfxarchive -size +10000000c -exec ll {} \;|more&lt;BR /&gt;&lt;BR /&gt;find /psnarchive -size +10000000c -exec ll {} \;|more&lt;BR /&gt;&lt;BR /&gt;Then i go through the directories and remove the files manually.&lt;BR /&gt;&lt;BR /&gt;I would like to automate this process into a script to save time.&lt;BR /&gt;&lt;BR /&gt;Any ideas&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;&lt;BR /&gt;George&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 17 Dec 2002 11:54:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/filesystem-maintenance-script-help/m-p/2865617#M97147</guid>
      <dc:creator>George_Dodds</dc:creator>
      <dc:date>2002-12-17T11:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: Filesystem Maintenance script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/filesystem-maintenance-script-help/m-p/2865618#M97148</link>
      <description>If youre sure the find correctly finds only the files you want to delete then simply change the end of it to;&lt;BR /&gt;&lt;BR /&gt;-exec rm -f {} \;&lt;BR /&gt;&lt;BR /&gt;and it will find and remove in one go.&lt;BR /&gt;</description>
      <pubDate>Tue, 17 Dec 2002 11:59:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/filesystem-maintenance-script-help/m-p/2865618#M97148</guid>
      <dc:creator>Stefan Farrelly</dc:creator>
      <dc:date>2002-12-17T11:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: Filesystem Maintenance script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/filesystem-maintenance-script-help/m-p/2865619#M97149</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I may be too stupid to understand what you mean, but...&lt;BR /&gt;&lt;BR /&gt;you've got it already! ;-)&lt;BR /&gt;&lt;BR /&gt;find /pfxarchive -size +10000000c -exec rm {} \;&lt;BR /&gt;&lt;BR /&gt;and &lt;BR /&gt;find /psnarchive -size +10000000c -exec rm {} \;&lt;BR /&gt;&lt;BR /&gt;will remove automatically the files...&lt;BR /&gt;&lt;BR /&gt;of course, if you've aliased rm to rm -i, may have to unalias it: &lt;BR /&gt;unalias rm&lt;BR /&gt;&lt;BR /&gt;you could also use rm -f instead of rm, but that's a _bad_ idea if you're running the script as root ;-P&lt;BR /&gt;Cheers,&lt;BR /&gt;&lt;BR /&gt;FiX</description>
      <pubDate>Tue, 17 Dec 2002 12:02:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/filesystem-maintenance-script-help/m-p/2865619#M97149</guid>
      <dc:creator>F. X. de Montgolfier</dc:creator>
      <dc:date>2002-12-17T12:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: Filesystem Maintenance script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/filesystem-maintenance-script-help/m-p/2865620#M97150</link>
      <description>Of course substitue the ll for rm!&lt;BR /&gt;&lt;BR /&gt;I think i've been on the stupid pills again :)&lt;BR /&gt;&lt;BR /&gt;Thanks for the quick response.&lt;BR /&gt;&lt;BR /&gt;George</description>
      <pubDate>Tue, 17 Dec 2002 12:05:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/filesystem-maintenance-script-help/m-p/2865620#M97150</guid>
      <dc:creator>George_Dodds</dc:creator>
      <dc:date>2002-12-17T12:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: Filesystem Maintenance script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/filesystem-maintenance-script-help/m-p/2865621#M97151</link>
      <description>As with all good scripting techniques, don't re;y on the current environment (ie, aliasing). Change exec ll to exec /usr/bin/rm and all will be well. You can always override the aliased rm -i by adding -f to turn off the -i.&lt;BR /&gt;&lt;BR /&gt;MOST IMPORTANT: find without the -type option will find everything (sockets, files, directories, links, device files, etc). Use -type f to limit the choices if these directories do (or may someday) contain directories. The rm command will fail to remove directories without the -r option, but this is a dangerous option for untested scripts.</description>
      <pubDate>Tue, 17 Dec 2002 12:50:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/filesystem-maintenance-script-help/m-p/2865621#M97151</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2002-12-17T12:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: Filesystem Maintenance script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/filesystem-maintenance-script-help/m-p/2865622#M97152</link>
      <description>Usually when I do something like this, I want to log what files are removed.  I do this as two steps, one using the find command to create a text file, and the second to parse the text file and actually remove the files.  You can do these as two separate scripts or in a single script:&lt;BR /&gt;for FILE in  `find /pfxarchive -size +10000000c -exec ll {} \`&lt;BR /&gt;do&lt;BR /&gt;      echo $FILE&amp;gt;&amp;gt;LOGFILE&lt;BR /&gt;      rm $FILE&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;This isn't very efficient, it could probably be done within the find command all by itself.  But this one is easy to write and maintain.&lt;BR /&gt;&lt;BR /&gt;Good Luck&lt;BR /&gt;Chris&lt;BR /&gt;</description>
      <pubDate>Tue, 17 Dec 2002 18:30:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/filesystem-maintenance-script-help/m-p/2865622#M97152</guid>
      <dc:creator>Chris Vail</dc:creator>
      <dc:date>2002-12-17T18:30:36Z</dc:date>
    </item>
  </channel>
</rss>

