Copying configuration fails for files in subdirectories
When a file should be copied to a subdirectory of
Configuration/*/, e.g. for a subcontext, the scp operation fails.
The (misleading) error message is
scp: /var/www/.../Configuration/Production/Subcontext/: Is a directory – the real cause is that the directory does not exist and thus scp would rather copy the file to the folder path, which is pointless as the path points to a directory.
Solution would be to execute a
mkdir -p ...$configurationPath before copying the file.