Hello,
I can't seem to be able to convince scp to behave.
For test data
ubuntu@domU-12-31-38-00-D4-F1:/tmp$ find /tmp/a1/
/tmp/a1/
/tmp/a1/a2
/tmp/a1/a2/a3
On issuing the command
ubuntu@domU-12-31-38-00-D4-F1:/tmp$ scp -r /tmp/a1 domU-12-31-38-00-E2-52.compute-1.internal:/tmp/a1
I would expect the same directory structure created on domU-12-31-38-00-E2-52.compute-1.internal, whatever the directory /tmp/a1 exists on target host or not. Instead, what scp actually creates is the following structure (if /tmp/a1 exists on target host)
ubuntu@domU-12-31-38-00-D4-F1:/tmp$ ssh domU-12-31-38-00-E2-52.compute-1.internal find /tmp/a1
/tmp/a1
/tmp/a1/a1
/tmp/a1/a1/a2
/tmp/a1/a1/a2/a3
How can scp be forced to copy into given directory as the root of the operation?
Later on I would like to script this operation so that given directory path on master I can call a script that will replicate the same directory structure to all slaves. Please note that rsync behavior (at least from what I've tested) is the same in this manner.
Thank you, Maxim.