How to use SCP to copy a deep directory

copydirectoryscp

I need to copy a deep directory on one windows machine over 'itself' on another windows machine. I can't seem to get the command to work correctly. The current problem is that it appears that scp is stripping the slashes out of the source parameter.

scp -v -r COMPUTER1:D:\A\B COMPUTER2:D:\A\B

I've also just tried to copy to a different name like

scp -v -r COMPUTER1:D:\A\B COMPUTER2:D:\A\B1

Best Answer

I'm pretty sure the problem is that those are backslashes and need to be escaped properly (I don't do Windows but I'd try using 2 backslashes instead of one).

If you still can't figure out the right syntax to escape it, use WinSCP

You might also want to look into rsync which provides not only the security ssh has (by tunneling thru it) but also adds the benefit of incremental copies. You only copy what you need.

Among other features it has a very powerful inclusion/exclusion syntax as well as a really useful server mode.