Suppose my build script creates something like:
build
├── [drwxr-xr-x pskocik pskocik ] bin
│ └── [-rwxr-xr-x pskocik pskocik ] FOO_bin
├── [drwxr-xr-x pskocik pskocik ] include
│ ├── [drwxr-xr-x pskocik pskocik ] FOO
│ │ ├── [-rw-r--r-- pskocik pskocik ] FOO_a.h
│ │ └── [-rw-r--r-- pskocik pskocik ] FOO_b.h
│ └── [-rw-r--r-- pskocik pskocik ] FOO.h
├── [drwxr-xr-x pskocik pskocik ] lib
│ ├── [-rw-r--r-- pskocik pskocik ] libFOO.a
│ └── [-rwxr-xr-x pskocik pskocik ] libFOO.so
└── [drwxr-xr-x pskocik pskocik ] share
└── [drwxr-xr-x pskocik pskocik ] man
├── [drwxr-xr-x pskocik pskocik ] man1
│ └── [-rw-r--r-- pskocik pskocik ] FOO.1.gz
└── [drwxr-xr-x pskocik pskocik ] man3
└── [-rw-r--r-- pskocik pskocik ] FOO.3.gz
8 directories, 8 files
What's the best way to copy this, say into /usr or /usr/local, so that
- files get reowned to root:root
- file modes stay untouched
- the same applies to directory nodes unless (optional) they already existed (in which case their ownerships and modes remain the same)
?
-Aand-Xoptions :) – Jun 23 '17 at 11:34archiveoption(-athat implies-rlptgoD), that's why i broke down into-rltpDvand removed the group and ownership options. what about if you usersync -avh --chown root:root build/ /usr/? – Jun 23 '17 at 11:44