Found a solution. Use -p and --parent with the cp command. It's a
bit of a kludge as cp complains a bit, but works:
$ true && (
mkdir -p t1/a/b/c/d/e/f/g
chmod go-rwx t1/a/b/c/
target=$PWD/t2
mkdir $target
( cd t1
cp -p --parent ./a/b/c/d/e/. $target/
)
)
$ tree -p
.
|-- [drwxr-xr-x] t1
| `-- [drwxr-xr-x] a
| `-- [drwxr-xr-x] b
| `-- [drwx------] c
| `-- [drwxr-xr-x] d
| `-- [drwxr-xr-x] e
| `-- [drwxr-xr-x] f
| `-- [drwxr-xr-x] g
`-- [drwxr-xr-x] t2
`-- [drwxr-xr-x] a
`-- [drwxr-xr-x] b
`-- [drwx------] c
`-- [drwxr-xr-x] d
`-- [drwxr-xr-x] e
Any other ways?
Regards,
- Robert
On Wed, Jun 16, 2010 at 8:25 AM, Robert Citek <[email protected]> wrote:
> How does one copy a path, preserving permissions, timestamp, and ownership?
--
Central West End Linux Users Group (via Google Groups)
Main page: http://www.cwelug.org
To post: [email protected]
To subscribe: [email protected]
To unsubscribe: [email protected]
More options: http://groups.google.com/group/cwelug