Operating System - HP-UX
1748019 Members
4242 Online
108757 Solutions
New Discussion

find command on NFS is returning "creates a cycle" for a .file (dot file)

 
kjohnsonm
Advisor

find command on NFS is returning "creates a cycle" for a .file (dot file)

after presetting Myfile and age in my script

 

find /mydir/mysubdir/ ! -name ".snapshot" -a -name "$Myfile.*.*.*.*.*" -a -mtime +$age -a -exec rm {} \;

 

Even with the exclusion of the .snapshot file I get this every time:

 

find: /mydir/mysubdir/.snapshot creates a cycle

 

I do not want to even look at this file... Can anyone help me clear this up?   I use this type of cleanup all the time on local disks and do not get any errors nor need the exculsion check...

TIA  -Keith

time is a preditor to us all, live now not in the future.
1 REPLY 1
Dennis Handly
Acclaimed Contributor

Re: find command on NFS is returning "creates a cycle" for a .snapshot

>I do not want to even look at this file

 

The proper find primary is -prune and if you want performance, you need "+":

find /mydir/mysubdir/ -name .snapshot -prune -o -name "$Myfile.*.*.*.*.*" -mtime +$age -exec rm {} +