You are not logged in.

#1 2007-09-05 03:02:56

y4mz
Member
Registered: 2007-06-16
Posts: 16

tar recursion problem

I'm trying to combine the --no-recursion and --recursion tar options like it says here: http://www.gnu.org/software/tar/manual/ … curse.html

The --no-recursion and --recursion options apply to later options and operands, and can be overridden by later occurrences of --no-recursion and --recursion. For example:

     $ tar -cf jams.tar --no-recursion grape --recursion grape/concord

creates an archive with one entry for grape, and the recursive contents of grape/concord, but no entries under grape other than grape/concord.

...but it doesn't seem to work. If I try the example, the contents of grape are archived, and the contents of grape/concord are archived twice. Is this a bug or am I missing something?

Offline

#2 2007-09-05 03:38:02

Purch
Member
From: Finland
Registered: 2006-02-23
Posts: 229

Re: tar recursion problem

$ tar -cf jams.tar grape/concord/*

Offline

#3 2007-09-05 04:47:53

y4mz
Member
Registered: 2007-06-16
Posts: 16

Re: tar recursion problem

Thanks, but that doesn't store the 'grape' and 'grape/concord' directories individually, so their owner/group/permissions are not stored, which is what I want.

But I figured out a way that works:  tar -cf jams.tar --no-recursion grape ; tar -rf jams.tar grape/concord

I can't see why the manual example doesn't work though.

Offline

#4 2007-09-05 08:43:12

vacant
Member
From: downstairs
Registered: 2004-11-05
Posts: 816

Re: tar recursion problem

Does it work as you want if you specify the recursion before the no-recursion option?

Offline

#5 2007-09-05 12:05:05

y4mz
Member
Registered: 2007-06-16
Posts: 16

Re: tar recursion problem

with:  tar -cf jams.tar --recursion grape/concord --no-recursion grape

only the 'grape' and 'grape/concord' directories are stored, nothing else.

Offline

Board footer

Powered by FluxBB