tar frustration (was Re: relative pathname question!)

Larry Dighera root at conexch.UUCP
Sun Aug 14 00:57:39 AEST 1988


In article <2858 at ttrdc.UUCP< levy at ttrdc.UUCP (Daniel R. Levy) writes:
<< <tar cf /dev/whatever *
<
<< I would suggest using "." rather than "*" to avoid the expansion of the commmand
<< line to ridiculously long lengths.  While the meaning is certainly different, I

<All this points up a "feature" of tar which I find frustrating:  if I want
<tar to tape-archive a large number of files randomly scattered all over the
<file system (such as for an incremental backup) I'm SOL because tar wants
<to be told either a directory to completely search or file names to archive,
<via the argument list.  "cpio" circumvents this problem, since I can feed it
<a list of files, but what if I don't WANT to use cpio?  (Say, in a situation
<which would trigger a known cpio bug, like inode numbers greater than 65535 or
<uid's less than 0 [a la SUN] when doing cpio -c.)  Using the "r" option of tar
<with repeated invocations of tar would work all right, but would be blastedly
<slow because it would rewind the tape over and over and over.  If I used the
<no-rewind tape device, I'd get a whole bunch of little tar archives, one for
<each invocation.

This is so simple that it makes me feel like I don't understand the problem.
If you want tar to take the names of the files it is to put into the archive
from a file which contains the names of the files, just do this:

	tar cvf /dev/whatever `cat file_of_names`

You can generate file_of_names with find just like is normally done with
cpio.  Ain't UNIX grand?

Larry Dighera



-- 
USPS: The Consultants' Exchange, PO Box 12100, Santa Ana, CA  92712
TELE: (714) 842-6348: BBS (N81); (714) 842-5851: Xenix guest account (E71)
UUCP: conexch Any ACU 2400 17148425851 "" "" ogin:-""-ogin:-""-ogin: nuucp
UUCP: ...!uunet!turnkey!conexch!root || ...!trwrb!ucla-an!conexch!root



More information about the Comp.unix.wizards mailing list