tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* SUMMARY: tar directory tree -- permissions wrong
@ 2002-02-20 16:20 Russ_Fish
  0 siblings, 0 replies; only message in thread
From: Russ_Fish @ 2002-02-20 16:20 UTC (permalink / raw)
  To: tru64-unix-managers

Thanks to all who answered--I got two replies before the message arrived
from the list!

1. Add "p" in the source tar call, so
cd /my/source/dir; tar cpvf - . | (cd /my/dest/dir; tar xpf -)

2. Use vdump/vrestore (this is the solution we used, and it worked great),
so
vdump -0 -f /sourcedir | (cd /destdir; vrestore -x -f -)
One person note there is a good example of this in the vdump man pages for
future reference.

3. Use gnu tar--has more options.

4. Use cpio and/or rsync, so
cd /my/source/dir; find . -mount -print | cpio -pdum /my/dest/dir
rsync -ax /my/source/dir/ /my/dest/dir

5. Use cp -rp.

6. Issue may disappear upon completion of tar/untar--root owns directories
in the interim (we did not se this behavior, but others noted there are
many versions of tar out there).

7. Ensure suid bit not set for group access in destionation tree.

Our original question is below:

I'm trying to copy a directory tree from one place to another using (as
root):

cd /my/source/dir; tar cvf - .| (cd /my/dest/dir; tar xpf -)

File permissions are coming across fine, but all directories in the
destination tree are owned by root. The owner owns the "dest" directory in
the example, and can create a directory in /my/dest/dir with mkdir.

All suggestions greatly appreciated.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-02-20 16:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-20 16:20 SUMMARY: tar directory tree -- permissions wrong Russ_Fish

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox