appending a directory structure to an existing archive

View: New views
3 Messages — Rating Filter:   Alert me  

appending a directory structure to an existing archive

by J.P. Trosclair :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm trying to append a directory structure to an existing tar archive. The
following works for creating an archive without any problems:

tar cfp test.tar --no-recursion --from-files <(find /var/lib/postfix
/var/spool/postfix -type d)

If I add the A or --catenate option then I receive an error:

tar pf test.tar --catenate --no-recursion --files-from <(find
/var/lib/postfix/ /var/spool/postfix/ -type d)
tar: /var/lib/postfix: Read error at byte 0, while reading 4096 bytes: Is a
directory
tar: Error is not recoverable: exiting now

Any ideas or am I barking up the wrong tree here? If it's not possible I
can think of other means to the same end, this just seems like the most
efficient method for what I'm looking to do.

Thanks



Re: appending a directory structure to an existing archive

by Sergey Poznyakoff-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

J.P. Trosclair <jptrosclair@...> ha escrit:

> tar pf test.tar --catenate --no-recursion --files-from <(find
> /var/lib/postfix/ /var/spool/postfix/ -type d)

The --catenate option concatenates two or more tar archives, not files
(see http://www.gnu.org/software/tar/manual/html_node/concatenate.html).

What you need to use is the --append (-r) option (see
http://www.gnu.org/software/tar/manual/html_node/appending-files.html),
e.g.:

find /var/lib/postfix/ /var/spool/postfix/ -type d |
 tar rpf test.tar --no-recursion --files-from -

Regards,
Sergey



Re: appending a directory structure to an existing archive

by J.P. Trosclair :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, 03 Sep 2009 20:04:27 +0300, Sergey Poznyakoff <gray@...>
wrote:
> The --catenate option concatenates two or more tar archives, not files
> (see http://www.gnu.org/software/tar/manual/html_node/concatenate.html).
>
> What you need to use is the --append (-r) option (see
> http://www.gnu.org/software/tar/manual/html_node/appending-files.html)

Thanks for the time and help and sorry about the confusion.

J.P.