In comp.unix.solaris Mark Hittinger <bugs@pu.net> wrote:
> GertK <gert.koopmanREMO@VETHISplanet.nl> writes:
>>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.
> Don't know about efficient since you've got to stay online. How about
> using a slightly backwards approach? Instead of attempting to go to
> the bottom and remove the file why not try removing things from the
> top end?
> For example:
> #! /bin/sh
> renice 5 $$
> while [ 1 ] ; do
> mv core_8286 core_8286.rm
> if [ $? -ne 0 ] ; then exit ; fi
> mv core_8286.rm/core_8286 .
> if [ $? -ne 0 ] ; then exit ; fi
> rmdir core_8286.rm
> if [ $? -ne 0 ] ; then exit ; fi
> done
> After one pass you have the same directory tree in core_8286 but with the
> top level snipped off. It could just grind away in the background until
> it hits the bottom.
Elegant! I don't think I would have thought of such an approach. It
nicely avoids the need to descend the tree in the first place.
I'd love to know exactly how deep the OP's chain was. I've only tested
with about 100K+ or so due to the time to create/kill the things.
--
Darren Dunham
ddunham@taos.com
Unix System Administrator Taos - The SysAdmin Company
Got some Dr Pepper? San Francisco, CA bay area
< This line left intentionally blank to confuse you. >