[comp.unix.admin] find: stat

dag@fciva.FRANKLIN.COM (Daniel A. Graifer) (12/19/90)

We just cleared up an interesting problem that I don't believe I've
seen mentioned in this group over the last couple of years, so I
thought I would pass it on.

The symptoms.  We run /etc/cleanup out of root crontab every Sunday
morning.  This script contains the following line:

	find / -name core -atime +7 -exec rm -f {} \;

About 4 weeks ago, this began failing, generating a page full of
error messages like:

	find: stat() failed: /usr/ldbin/wp5/standard.prs: no such file or directory

An examination of the named files showed they were perfectly normal.  To make
a long story short, the file name just befre this one, "spell.exe", supposed
to be a Merge386 executable, was showing in an ls -l as a directory!  Looking
at the directory, we recognized it as a log directory for our database, and
in fact, cd'ing into spell.exe, then 'cd ..'ing left you in what was obviously
the database directory, but pwd had you back in /usr/ldbin/wp5!

Anyways, it was clear that the entry for spell.exe in the wp5 directory 
somehow got hosed, and now was a second link to the log directory.  A
quick /etc/unlink cleared up the problem.  Anybody have any ideas how this
could have happened in the first place?  In fact we had two such bogus
file/directory mixups in the wp5 directory!

Hope this helps somebody someday!

Dan