Thanks to Casper Dik <casper@holland.Sun.COM> , who suggested I run truss on
the find command to see where it's failing. Turns out there was a CD mounted
on the machine with a bunch of files in Macintosh format, which find didn't
take too kindly to. Unmounting the CD solved the problem. I suspect running
find and restricting the fstype to ufs would work too, though I didn't try
that.
Original post:
>Hi, all
>
>I have a script running as a cronjob that is supposed to look at all the local
>disks and delete certain files that are more than four weeks old. The script
>is as follows:
>
>#! /bin/csh
>if ("$1" == "") then
> echo "Syntax: syspurge top_directory [days_old]"
> echo
> exit
>endif
>#
>if ("$2" == "") then
> set days = "28"
>else
> set days = "$2"
>endif
>find $1 -local \( -name '*.backup' -o \
> -name '*.recover' -o \
> -name '*.auto' -o \
> -name '*.lck' -o \
> -name 'NoName*' -o \
> -name '*.backup.*' -o \
> -name '*.recover.*' -o \
> -name '*.auto.*' -o \
> -name '*.lck.*' -o \
> -name '*.bak' -o \
> -name '*.BAK' -o \
> -name '*.CKP' -o \
> -name core -o \
> -name '*.bck' -o \
> -name '#*' \) -mtime +$days -exec rm -f {} \;
>
>
>So I'm trying to get rid of extraneous backup and lock files left behind by
>various programs (Frame is a big culprit) as well as core dumps.
>
>Anyway, on a Sparc 20 running Solaris 2.6, the script works fine. On an Ultra
>2 running Solaris 2.5.1 with the 4/97 hardware update, it works fine.
However,
>on an Ultra 2 running generic Solaris 2.5.1, it bombs with the following
error:
>
>find: cannot open /: Invalid argument
>
>?? Nothing else seems to be having a problem with the root partition. When I
>run the command by hand on the other partitions on this machine, it seems to
be
>happy.
>
>Any ideas? None of the machines has any patches on it.
>
>TIA and IWS.
-- Bill Fenwick Email: fenwick@digicomp.com Digicomp Research Voice: (607) 273-5900 ext 32
This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:12:43 CDT