[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Really stupid use of cleanlinks



Hello there!

On Wednesday 06 August 2003 17:10, Anthony Campbell wrote:

> Never do this!
> 
> I just ran cleanlinks on my root directory; really stupid thing to
> do!
> 
> Lots of things were deleted which should not have been and I don't
> know how long it will take to get things back working; only just
> restored ppp. Possibly a new installation will be required?

Now that I came to think about it, the bug report I sent in [1]
doesn't seem to be quite sufficient.

Currently IMVHO this little script "cleanlinks" better shouldn't exist
at all in its current state, since
a) its handling of (dangling) symlinks is done far better by the
symlinks package
b) its cleaning of empty dirs is actually a simple one-liner
c) it doesn't do what it is supposed to do and thus
d) it can seriously screw up your system

If this script persists I think the following changes should be made:
a) see [1], somebody better check this for correctness
b) fix Colin's manpage (DIAGNOSTICS), as the message about empty
directories will be printed regardless of the results, and the user
doesn't get feedback about which dirs have been removed
c) or alternatively let it print out the names of removed dirs:
find . -type d -depth -print |
(
        read i
        echo \"$i\" empty, removing
        rmdir --ignore-fail-on-non-empty $i
)


What do you think?

Cheers,
Flo

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=204363



Reply to: