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

20030926: scour doesn't purge links like it used to



Arthur,

>Date: Fri, 26 Sep 2003 14:40:47 -0400 (EDT)
>From: "Arthur A. Person" <person@localhost.localdomain>
>Organization: Penn State
>To: Steve Emmerson <address@hidden>
>Subject: Re: 20030925: scour doesn't purge links like it used to 

The above message contained the following:

> Actually, I was running 5.1.4 on one of our production data systems here
> up until July (which is when this problem started ocurring) and it did not 
> have the "-type f" in the find command.
...

You're quite right.  I was confusing "find ... -type f" with the "-f"
option of the test(1) commands in the scour(1) script.

The "-type f" test should have been added to the find(1) command of the
scour(1) script in version 5.2 of the LDM (in 2002-07-23).  The change
was deliberate.  Here's the log entry for that change:

    Modified call to 'find' so that scour will not try to scour
    directories, only files.  (It couldn't rm the directories anyway,
    so in that case an error was reported.  It was decided that empty
    directories should not be removed so that users might more easily
    determine if a directory was erroneously missing data.)

Unfortunately, options of the find(1) command are operating-system
dependent.  Some find(1)s have a "-follow" option, and some have a
"-type l" option, and some have neither.  Consequently, it's impossible
to write a portable find(1) command-line in the scour(1) script that
does the right thing with symbolic links.

In your case (where you want symbolic links removed) I would replace
the line

    find . -type f -mtime +$FINDAGE -name "$pattern" \

with

    find . \( -type f -o -type l \) -mtime +$FINDAGE -name "$pattern" \

(assuming that your find(1) has the "-type l" option).

> Arthur A. Person
> Research Assistant, System Administrator
> Penn State Department of Meteorology
> email:  address@hidden, phone:  814-863-1563

Regards,
Steve Emmerson