Really OT: Any tar experts here?

From: Pete Turnbull <pete_at_dunnington.u-net.com>
Date: Tue Sep 14 02:21:57 1999

On Sep 13, 20:12, Roger Merchberger wrote:

> Essential info: Problem is, I have directories that I want backed up, but
> with subdirectories that I *don't* want backed up; yet when I feed the
list
> of dir's to tar, it recursively backs up the dir's anyway.
>
> Is there a way (program switch, special version of tar, anything...) to
> tell tar to not recurse subdirectories, or do I need to write a
sub-program
> that extracts each individual filename?

There are probably several ways. Here's a few I've used:

1) use the 'w' option to tar; it will prompt you for each file/dir to be
included. Could be tedious, though.

2) use GNU tar, which has an option to read a list of files/dirs to be
excluded, from a file. There's a similar option to read the list as part
of the command line. I can't remember the options (and this system doesn't
have GNU tar so I can't look them up) but I do remember you have to make
the pathnames in the file to be *exactly* as tar will see them.

3) use find (or your perl program) to create a list of files to be
archived, excluding all directory/subdirectory names; then it won't recurse
into subdirectories. Eg:

   find . -type p <rest of expression> -print | tar cf tarfile.tar -

The '-type p' makes find only print names of plain files, not directories
or special files, etc. Problem is that you will end up with a flat file in
which you can't distinguish which directory files came from from.

-- 
Pete						Peter Turnbull
						Dept. of Computer Science
						University of York
Received on Tue Sep 14 1999 - 02:21:57 BST

This archive was generated by hypermail 2.3.0 : Fri Oct 10 2014 - 23:32:36 BST