View Single Post

   
  #8 (permalink)  
Old 01-16-2008, 05:32 PM
cbigam@somewhereelse.nucleus.com
 
Posts: n/a
Default Re: How to efficiently remove large directory tree

In comp.unix.solaris GertK <gert.koopmanREMO@vethisplanet.nl> wrote:
> Hi,
>
> A oracle process has tried to dump a core but created recursively a very
> deeply nested directory structure like this instead:
> core_8286/core_8286/core_8286/core_8286/....etc etc. until the inodes
> ran out.


I've come across this once, and found some curious shell behaviour that
let me solve it.

One shell (I think /bin/sh) let me recursively cd down into the bottom
level of the directory. Once there, I could use a different shell
(/bin/ksh? Or maybe it was csh, but I doubt it) to recursively
"cd .. && rmdir <dirname>".

I think I was about 39k directories deep, and it took under an hour.

The other possiblity is that unlink might just wipe out the top level
directory. Don't know what happens to the previously allocated inodes
when you do it that way, though.

Colin
Reply With Quote