[comp.unix.i386] find in ISC 2.02

fritzz@lamont.ldgo.columbia.edu (fritz zaucker) (07/26/90)

I use find to backup my system (together with cpio or afio).
I have a couple of mounted file systems, which I don't want to
backup. Therefore I used the -local switch to find.
This works fine. Unfortunately there is one very huge file system
mounted (/usr/spool/news). Because of that, find spents a very long 
time in looking through this directory tree.
Is there a way to prevent that (except unmounting it)?

Thanks
Fritz

martin@mwtech.UUCP (Martin Weitzel) (07/27/90)

In article <2618@lamont.ldgo.columbia.edu> fritzz@lamont.ldgo.columbia.edu (fritz zaucker) writes:
>I use find to backup my system (together with cpio or afio).
>I have a couple of mounted file systems, which I don't want to
>backup. Therefore I used the -local switch to find.

IMHO find <path> -mount -print seems what your are looking for ...
                 ^^^^^^
In this case the entire sub-tree isn't looked at if some directory
is on another device than the one that is currently scanned.
-- 
Martin Weitzel, email: martin@mwtech.UUCP, voice: 49-(0)6151-6 56 83

rsj@wa4mei.UUCP (Randy Jarrett) (07/27/90)

In <2618@lamont.ldgo.columbia.edu> fritzz@lamont.ldgo.columbia.edu (fritz zaucker) writes:

>I use find to backup my system (together with cpio or afio).
>I have a couple of mounted file systems, which I don't want to
>backup. Therefore I used the -local switch to find.
>This works fine. Unfortunately there is one very huge file system
>mounted (/usr/spool/news). Because of that, find spents a very long 
>time in looking through this directory tree.
>Is there a way to prevent that (except unmounting it)?

>Thanks
>Fritz

I was having a similar problem at work. I had a system to backup
that had two nfs file systems mounted.  The work-a-round that I ended
up using was as follows.

	/bin/ls / | grep -v unwanted-file-system >/tmp/files
	sort -o /tmp/files /tmp/files	(I like neat lists)
	cat /tmp/files | cpio(or afio) -options >/dev/tape-device

This way eliminates the need to unmount the file system or waste
a lot of time searching through unwanted directories.

---

Randy Jarrett  WA4MEI 
UUCP  ...!{emory,gatech}!wa4mei!rsj   | US SNAIL: P.O. Box 941217
PHONE +1 404 493 9017		      |           Atlanta, GA 30341-0217

jon@savant.UUCP (Jon Gefaell) (07/31/90)

In article <655@wa4mei.UUCP> rsj@wa4mei.UUCP (Randy Jarrett) writes:
>In <2618@lamont.ldgo.columbia.edu> fritzz@lamont.ldgo.columbia.edu (fritz zaucker) writes:
>
>>I use find to backup my system (together with cpio or afio).
>>I have a couple of mounted file systems, which I don't want to
>>backup. Therefore I used the -local switch to find.
>
>>Thanks
>>Fritz
>
>This way eliminates the need to unmount the file system or waste
>a lot of time searching through unwanted directories.
>

I feed cpio W/ find, and use the -mount option. Works nicely...
>---
>

-- 
+----------- Domain? DOMAIN? We Don't Need No Steeeenkin' Domain! -----------+
|     /\                                                                     |
|   /    \                                                                   |
|  /       \                                                                 |
| ~~~~~~~~~~                                                                 |
+-savant!jon@virginia.edu {...}!uunet!virginia!savant!jon jeg7e@virginia.edu-+

nvk@ddsw1.MCS.COM (Norman Kohn) (07/31/90)

In article <2618@lamont.ldgo.columbia.edu> fritzz@lamont.ldgo.columbia.edu (fritz zaucker) writes:
>I use find to backup my system (together with cpio or afio).
>... find spents a very long 
>time in looking through this directory tree.
>Is there a way to prevent that (searching an unwanted directory)

find . ! -name /usr/unwanted/\* ...


-- 
Norman Kohn   		| ...ddsw1!nvk
Chicago, Il.		| days/ans svc: (312) 650-6840
			| eves: (312) 373-0564

guy@auspex.auspex.com (Guy Harris) (08/02/90)

>>... find spents a very long 
>>time in looking through this directory tree.
>>Is there a way to prevent that (searching an unwanted directory)
>
>find . ! -name /usr/unwanted/\* ...

Nice try, but you don't win the dining room set.  The "-name" predicate
checks *component* names, not *path* names; using "-name", you can tell
"find" to ignore any file whose last component is "unwanted", but you
can't tell it to ignore any file in directory "/usr/unwanted" in that
way.

jon@savant.UUCP (Jon Gefaell) (08/07/90)

In article <3805@auspex.auspex.com> guy@auspex.auspex.com (Guy Harris) writes:
>>>... find spents a very long 
>>>time in looking through this directory tree.
>>>Is there a way to prevent that (searching an unwanted directory)
>>
>>find . ! -name /usr/unwanted/\* ...
>
>Nice try, but you don't win the dining room set.  The "-name" predicate
>checks *component* names, not *path* names; using "-name", you can tell
>"find" to ignore any file whose last component is "unwanted", but you
>can't tell it to ignore any file in directory "/usr/unwanted" in that
>way.

Woudn't find . -type d -name ! /usr/unwanted do the trick? I have no idea, I'm
just a novice :)
-- 
+----------- Domain? DOMAIN? We Don't Need No Steeeenkin' Domain! -----------+
|     /\                                                                     |
|   /    \                                                                   |
|  /       \                                                                 |
| ~~~~~~~~~~                                                                 |
+-savant!jon@virginia.edu {...}!uunet!virginia!savant!jon jeg7e@virginia.edu-+