General
Showing results for 
Search instead for 
Do you mean 

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

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 REPLIES
Highlighted
Acclaimed Contributor Acclaimed Contributor

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

[ Edited ]

>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 {} +