SUMMARY: tar - an easy question

From: Mark Schlam <mslist_at_castle.beaver.edu>
Date: Thu, 30 Jul 1998 07:49:42 -0400 (EDT)

Dear Managers:
I never cease to be amazed at the speed of responses from this list.
Thanks to all!
Here are the first responses, many of which are similar,
but if you look carefully at the comments
they all provide very interesting insights.
Mark


From: Arno Hahma <arno_at_nitro.pp.utu.fi>
cd /usr/users/foo; tar cpf - . | (cd /newdir/usr/users/foo; tar xBvpf - )

Skip the v from the last tar, if you don't want to see, what's
happening. You can skip the B, if both directories are local.

From: "S.Barbaresi" <s.barbaresi_at_bangor.ac.uk>
        cd /usr/users/foo
        tar cf - * | ( cd /newdir/use/users/foo ; tar xvpf - )

"cd" first otherwise you will get absolute pathnames!

From: Thomas Leitner <tom_at_finwds01.tu-graz.ac.at>

cd /
tar cpf - usr/users/foo | (cd /newdir; tar xpvf -)

I would do it with vdump, though:

cd /usr/users
mkdir /newdir/usr/users/foo
vdump -D -0 -u -f - foo | vrestore -x -f - -D /newdir/usr/users/foo
Tom

From: milan.lesnik_at_uni-mb.si
cd /usr/users/foo
#
# chose device with enough free space
#
tar cvf ../something.tar .
cd /newdir/usr/users/foo
tar xvpf /usr/users/something.tar
Milan

>From rb237_at_phy.cam.ac.uk Thu Jul 30 07:33:43 1998
Okay. Try this:
# cd /usr/users/
# tar cf - foo | (cd /newdir/usr/users; tar xvf -)

Regards,
Rich

>From shirish_jani_at_hotmail.com Thu Jul 30 07:33:47 1998
>Hi,
I suppose u should try following from the /usr/users/foo dir
% tar cvf - . | ( cd /newdir/usr/users/foo ; tar xvf -)
this is slightly time consuming but will work.
Shirish Jani


From: "Andrew L. Weston" <andreww_at_adacel.com.au>
To: mslist_at_castle.beaver.edu

cd /usr/users/foo
tar cf - . | ( cd /newdir/usr/users/foo && tar xvpf - )

(The && ensures that the cd worked before running tar)

>From rem_at_ams.org Thu Jul 30 07:34:05 1998
From: Robert E Morse <rem_at_ams.org>

Here is the syntax I would use:

cd /usr/users
tar cf - foo* | "cd /newdir/usr/users; tar -xpf -"

or if the target dir is already created,

cd /usr/users/foo
tar cf - * | "cd /newdir/usr/users/foo; tar -xpf -"


>From marcink_at_ex-mail.crt.tpsa.pl Thu Jul 30 07:34:13 1998
From: Kasperski Marcin <marcink_at_ex-mail.crt.tpsa.pl>

(cd /usr/users/foo; tar cf - . ) | (cd /newdir/usr/users/foo; tar xf - )


>From imrozek_at_pakpol.ahlstrom.com Thu Jul 30 07:34:17 1998
From: Ireneusz Mrozek <imrozek_at_pakpol.ahlstrom.com>


I don't know if I help you, because I suggest you use cpio. This is
solution with cpio ( you have to be in source directory):

                find . -depth -print | cpio -pd newdir
                                                ^^^^^^^
                                                destination

(solution from "Unix Power Tools" - O'REILLY)

From: Robert Kubarych <rkubaryc_at_sunyrockland.edu>
I think this will do the trick.

cd /newdir/usr/users
tar -cf - -C /usr/users foo | tar -xvpf -


original question:
> Can someone provide the exact tar syntax to copy an entire directory
> structure using tar from one disk drive to another under du4.0b.
>
> The directory to be copied is /usr/users/foo and everything below
> /usr/users/foo. The target is /newdir/usr/users/foo. I will summarize.
Received on Thu Jul 30 1998 - 11:47:11 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:38 NZDT