I need to create a deploy script to combine the following directory structure:
├── LIB_COMMON
│ ├── file1.php
│ ├── file2.php
│ ├── file3.php
│ └── file4.php
├── LIB_CZ
│ ├── file2.php
│ ├── file3.php
│ ├── file5.php
│ └── file6.php
...which result should look like:
├── LIB_RESULT
│ ├── file1.php ...with content from LIB_COMMON
│ ├── file2.php ...from LIB_CZ
│ ├── file3.php ...from LIB_CZ
│ ├── file4.php ...from LIB_COMMON
│ ├── file5.php ...from LIB_CZ
│ └── file6.php ...from LIB_CZ
One way to do it is:
rsync LIB_COMMON/ LIB_RESULT/ --delete-after
rsync LIB_CZ/ LIB_RESULT/
...but this will always transfer many files.
Other way could be:
cp LIB_COMMON/ TMP/
cp LIB_CZ/ TMP/
rsync TMP/ LIB_RESULT/ --delete-after
So, Does anyone know an elegant way to achieve this?