Thanks!
Why is this happening [...]
In the command scp -r path/to/source dest
:
dest
doesn't exist, the dest
directory will be created, and path/to/source/*
will be copied into it. For example if you have path/to/source/X
then dest/X
will be created.dest
is a directory, then dest/source
will be created, and the path/to/source/*
will be copied into it. For example if you have path/to/source/X
then dest/source/X
will be created.[...] and how should I fix/get around it?
Create dest
in advance, for example:
mkdir -p /local/path/logs
scp -r $SERVERS:/remote/path/dir /local/path/logs