UUCP files/directories being removed under SCO UNIX

Ken Keirnan kjk at PacBell.COM
Wed Jun 6 04:50:50 AEST 1990

In article <45 at raysnec.UUCP> shwake at raysnec.UUCP (Ray Shwake) writes:
>On at least two occasions, all the files in /usr/lib/uucp except uugetty
>and a local subdirectory were removed at 23:45 upon running uudemon.clean.
>Yet on other occasions it functioned correctly. This morning I found,
>again at 23:45 the sub-directories in /usr/spool/uucp/.Log were removed.
>Has anyone else experienced such occurrences??? Please email if you have
>any ideas.

Some versions of the HDB cleanup script(s) do a very bad thing.  They
assume all the files under /usr/spool/uucp are directory names.  The "for"
loop that does the cleanup looks something like:

		cd /usr/spool/uucp

		for i in *
			cd $i

			cleanup code

			cd ..

Note that if one of the files in /usr/spool/uucp is not a directory (an
ordinary file created by accident or by a locally developed program), the
"cd $i" will fail leaving the program in /usr/spool/uucp and the "cd .."
at the end of the loop will change directory to /usr/spool and the cleanup
will continue from there.  If this happens again, you are in /usr... you
can figure out the rest.

I strongly recommend if you have the above problem, to add a line at the
top of the "for" loop to insure a directory is being processed:

		for i in *
			if [ ! -d $i ]; then

			cd $i

Even better, also modify the "cd $i" to read "cd /usr/spool/uucp/$i" just
to be sure.

Hope this helps.

Ken Keirnan
Pacific Bell

Ken Keirnan - Pacific Bell - {att,bellcore,sun,ames,pyramid}!pacbell!kjk
  San Ramon, California	                    kjk at PacBell.COM

More information about the Comp.unix.i386 mailing list