From: Russ_Fish () idx ! com
To: tru64-unix-managers
Subject: SUMMARY: tar directory tree -- permissions wrong
Date: Wed, 20 Feb 2002 16:20:49 +0000 [thread overview]
Message-ID: <102653731622343.tru64-unix-managers.marc@archive.invalid> (raw)
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.
reply other threads:[~2002-02-20 16:20 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox