Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!pitt!darth!investor.pgh.pa.us!rbp From: rbp@investor.pgh.pa.us (Bob Peirce #305) Newsgroups: comp.unix.wizards Subject: Re: Should find traverse symbolic links? Message-ID: <1991Mar8.152932.5242@investor.pgh.pa.us> Date: 8 Mar 91 15:29:32 GMT References: <1991Feb25.130613.2553@phri.nyu.edu> <1991Feb25.143543.4213@mp.cs.niu.edu> Reply-To: rbp@investor.pgh.pa.us (Bob Peirce #305) Organization: Cookson, Peirce & Co., Pittsburgh, PA Lines: 31 In article <1991Feb25.143543.4213@mp.cs.niu.edu> rickert@mp.cs.niu.edu (Neil Rickert) writes: >In article <1991Feb25.130613.2553@phri.nyu.edu> roy@alanine.phri.nyu.edu (Roy Smith) writes: >> I was surprised to observe today that if you do "find dir ..." and >>dir is a symbolic link to a directory, the directory isn't entered. Thus: >> > Now just imagine I run a script overnight to remove stale core files. > Naturally I use something like: > > find . -atime +7 -name core -exec rm \{\} \; > > But, unbeknowns to me, some user has done the following: > > ln -s / root > > If find followed symbolic links, how long do you think it would take this >script to complete its execution? About seven hours. At least that's what I recently discovered on my Altos 3068. Altos' find does traverse symbolic links, which are implemented under SysV and, therefore, may be strange. Altos also has worknet, where the top level directory is @ and this is linked to /AT by ln -s @ /AT. Therefore, when cron says find / -type p -print > /FIFOs as it does each night because tar doesn't back them up, you get into an endless loop which eventually dies for no apparent reason. Maybe it uses all the space on the root partition. That would stop it. -- Bob Peirce, Pittsburgh, PA 412-471-5320 ...!uunet!pitt!investor!rbp rbp@investor.pgh.pa.us