[comp.unix.wizards] a new

trb@ima.UUCP (11/23/86)

I have been using cpio to save filesystems to move from a Sys V to a
4.3bsd.  I am happier with cpio than with tar; let's assume that I have
to use cpio (I have the BRL Sys V cpio on 4.3).

As we know, cpio likes a list of files on standard input.  Problem is,
people normally use find to generate that list, but it happily crosses
filesystem boundaries.  How to generate a list of files on a filesystem
for cpio?  find | grep -v?  No, ncheck!

Yes, hackers, ncheck has not quite been totally superseded by fsck!
Ncheck generates a list of i-number/pathname pairs.  Just run the
output through sed -e 's%[/]*/%%' and you're off!  Ncheck stupidly
prints the filesystem name followed by a colon as its first line of
output, but cpio will ignore that (or you can sed it out).

	Andrew Tannenbaum   Interactive   Boston, MA   +1 617 247 1155
	Society for the Preservation of Obsolete
	File System Maintenance Utilities

ggs@ulysses.UUCP (11/23/86)

> I have been using cpio to save filesystems to move from a Sys V to a
> 4.3bsd.  I am happier with cpio than with tar; let's assume that I have
> to use cpio (I have the BRL Sys V cpio on 4.3).
> 
> As we know, cpio likes a list of files on standard input.  Problem is,
> people normally use find to generate that list, but it happily crosses
> filesystem boundaries.  How to generate a list of files on a filesystem
> for cpio?  find | grep -v?  No, ncheck!
> 
> 	Andrew Tannenbaum   Interactive   Boston, MA   +1 617 247 1155

Fine, but the 4.3BSD "find" has the -xdev option, which does what you want.

	find /usr -xdev -print | cpio ocB > /dev/rmtfoo

-- 

Griff Smith	AT&T (Bell Laboratories), Murray Hill
Phone:		(201) 582-7736
UUCP:		{allegra|ihnp4}!ulysses!ggs
Internet:	ggs@ulysses.uucp

gm@lmi-angel.UUCP (Greg McGary) (11/24/86)

In article <269@ima.UUCP>, trb@ima.UUCP (Andrew Tannenbaum) writes:
> As we know, cpio likes a list of files on standard input.  Problem is,
> people normally use find to generate that list, but it happily crosses
> filesystem boundaries.  How to generate a list of files on a filesystem
> for cpio?  find | grep -v?  No, ncheck!

I added a `-mount' option to our find(1) to prevent it from traversing
mount points. E.g.

	find / -mount -print

gets you the root and nothing else.

I also added a `-magic' option for checking magic numbers.  You can
specify short or long integers in any radix and also strings.  This is
particularly useful for making source distributions from a hierarchy
that is littered with .o's, load-modules, cpio images, and archives
crated by ar(1).  E.g.

	find /src -magic 0520 -magic 070707 -smagic 070707 \
		-smagic "<ar>" -smagic "!<arch>" -print

excludes m68k COFF files, cpio archives, cpio archives with
ascii-headers, plus old and new-style System-V archives.  If you wish
to include files with particular magic numbers, `+magic' does so for
integer magic-numbers and `+smagic' does it for string magic-numbers.
If the integer magic-number is a long, append `L' or `l' to the
digits.

I vaguely recall that there was a discussion some months ago about
enhancements to find(1).  Unfortunately, I missed.  If someone has a
summary of the discussion, please forward it to me.
-- 
-- Greg McGary        {decvax!cca,harvard,mit-eddie}!lmi-angel!gm
--
``Make something of yourself! ... Try a casserole!''

wbp@cuuxb.UUCP (11/26/86)

In article <269@ima.UUCP> trb@ima.UUCP (Andrew Tannenbaum) writes:
>
>	<backup via find piped to cpio>
>
>As we know, cpio likes a list of files on standard input.  Problem is,
>people normally use find to generate that list, but it happily crosses
>filesystem boundaries.  How to generate a list of files on a filesystem
>for cpio?  find | grep -v?  No, ncheck!

In System V Release 3.0 and onwards, the option "-mount" has been
added pretty much for this reason.  (More specifically for little
machines such as a 3b2 for backing up to cartridge tape, which uses a
modified version of cpio that knows how to stream the tape.)  When the
"-mount" option is specified find will not cross over mount points.


   Walt Pesch
   {ihnp4,akgua,et al}!cuuxb!wbp
   cuuxb!wbp@lll-crg

whp@cbnap.UUCP (W. H. Pollock x4575 3S235) (11/26/86)

In system V 2.0 (at least) there is a utility "ff" for Fast Find.  It
resides in /etc usually, and is documented under "ff(1M)".   It has
fewer options than regular find, but it works by running through the
inode list of a file system.  This makes it faster; it also finds
all files in a file system (regular find will miss any files hidden
under a mount point).  I use ff regularly for producing backup dumps.

Wayne H. Pollock,
The Shell Answer Man
UUCP:	...{ihnp4,cbatt}!cbnap!whp
DELPHI:	WHP
GEnie:	W.POLLOCK

	"The opinions expressed above are ficticious.  Any resemblance
	to the opinions of persons living or dead is purely coincidental."