Hi,
I am having trouble using unix find and excluding anything in .snapshot.
I can't see any flag for exclude
Suggestions???
Thanks Stephen Darragh
the only trick I know is : mount one level up above the actual point you mount then, launch your find inside the subdir because .snapshot are not visible one level down an mount point
if you mount /vol/vol0/mytest in your /mnt/mytest and try to launch a find in /mnt/mytest, find will go inside .snapshot
beside that, if you mount /vol/vol0 in /mnt/mytest2 you can cd in /mnt/mytest2/mytest and launch your find, this time, it won't go inside .snapshot
the best would be to code a new GNU version of the find utility to integer an exclude path mechanism : )
Darragh, Stephen J wrote:
Hi,
I am having trouble using unix find and excluding anything in .snapshot.
I can't see any flag for exclude
Suggestions???
Thanks Stephen Darragh
how about: find . -name .snapshot -prune -o -name *.txt -print
On Fri, 14 Nov 2003, Stephane Bentebba wrote:
the only trick I know is : mount one level up above the actual point you mount then, launch your find inside the subdir because .snapshot are not visible one level down an mount point
if you mount /vol/vol0/mytest in your /mnt/mytest and try to launch a find in /mnt/mytest, find will go inside .snapshot
beside that, if you mount /vol/vol0 in /mnt/mytest2 you can cd in /mnt/mytest2/mytest and launch your find, this time, it won't go inside .snapshot
the best would be to code a new GNU version of the find utility to integer an exclude path mechanism : )
Darragh, Stephen J wrote:
Hi,
I am having trouble using unix find and excluding anything in .snapshot.
I can't see any flag for exclude
Suggestions???
Thanks Stephen Darragh
-- -- jetez un oeil ici http://www.sensiva.com/ -- -- have a look here http://www.sensiva.com/ --
real fanku to all <smile> bye
David Watson wrote:
how about: find . -name .snapshot -prune -o -name *.txt -print
On Fri, 14 Nov 2003, Stephane Bentebba wrote:
the only trick I know is : mount one level up above the actual point you mount then, launch your find inside the subdir because .snapshot are not visible one level down an mount point
if you mount /vol/vol0/mytest in your /mnt/mytest and try to launch a find in /mnt/mytest, find will go inside .snapshot
beside that, if you mount /vol/vol0 in /mnt/mytest2 you can cd in /mnt/mytest2/mytest and launch your find, this time, it won't go inside .snapshot
the best would be to code a new GNU version of the find utility to integer an exclude path mechanism : )
Darragh, Stephen J wrote:
Hi,
I am having trouble using unix find and excluding anything in .snapshot.
I can't see any flag for exclude
Suggestions???
Thanks Stephen Darragh
-- -- jetez un oeil ici http://www.sensiva.com/ -- -- have a look here http://www.sensiva.com/ --
Hi,
I am having trouble using unix find and excluding anything in .snapshot.
I can't see any flag for exclude
Suggestions???
Try this:
find . ( -name .snapshot -prune ) -o -print
Of course, you can replace -print with anything else that you want to do. If you want to do something more complex than -print I suggest surrounding it with ( and ) rather than rely on default operator precedence.
find . ( -name .snapshot -prune ) -o ( -user fred -print )
The above example skips anything named .snapshot and prints the names of files owned by user fred.
Steve Losen scl@virginia.edu phone: 434-924-0640
University of Virginia ITC Unix Support
Hi Stephen,
Here's a find command we use to clean up our scratch system of files that have not been accessed for more than 14 days. Certain directories are exempt from the cleanup, including .snapshot.
/sbin/find /scratch ( -type d -name staff -prune ) -o ( -type d -name export -prune ) -o ( -type d -name .snapshot -prune ) -o -atime +14 -exec rm -f {} ;
Steve Bailey
On Nov 14, 2003, at 8:05 AM, Darragh, Stephen J wrote:
Hi,
I am having trouble using unix find and excluding anything in .snapshot.
I can't see any flag for exclude
Suggestions???
Thanks Stephen Darragh
Uhmmmm -prune
find /fu/bar ( -type d -name .snapshot -prune ) -o ...
-prune Always yields true. Does not examine any directories or files in the directory structure below the pattern just matched. (See EXAMPLES). If -depth is specified, -prune will have no effect.
As the man page says. the syntax is painful... <scw>
On Fri, Nov 14, 2003 at 08:05:53AM -0500, Darragh, Stephen J wrote:
Hi,
I am having trouble using unix find and excluding anything in .snapshot.
I can't see any flag for exclude
Suggestions???
Thanks Stephen Darragh