From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96078715812034.tru64-unix-managers.marc@archive.invalid> From: Mark Schlam Date: Thu, 30 Jul 1998 11:49:42 +0000 To: tru64-unix-managers Subject: SUMMARY: tar - an easy question X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96078715812034 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 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" cd /usr/users/foo tar cf - * | ( cd /newdir/use/users/foo ; tar xvpf - ) "cd" first otherwise you will get absolute pathnames! From: Thomas Leitner 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@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@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@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" To: mslist@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@ams.org Thu Jul 30 07:34:05 1998 From: Robert E Morse 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@ex-mail.crt.tpsa.pl Thu Jul 30 07:34:13 1998 From: Kasperski Marcin (cd /usr/users/foo; tar cf - . ) | (cd /newdir/usr/users/foo; tar xf - ) >From imrozek@pakpol.ahlstrom.com Thu Jul 30 07:34:17 1998 From: Ireneusz Mrozek 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 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.