0

I need a script for my Java project (on Ubuntu) to deploy the .jar file to a remote windows server using scp.

This is what my script looks like:

scp build/libs/app.jar foo@192.68.40.41:test/

The app.jar is being copied to the Windows path C:\Users\foo\test. What I need is that the .jar file is copied to the following path: C:\server

I tried the following:

scp build/libs/app.jar foo@192.68.40.41:..\..\server

But it failed cause the script could not find the directory

I then tried to be absolute

scp build/libs/app.jar foo@192.68.40.41:c:\server

Same issue. What happens is that scp created some kind of file without file extension called server - omitting the c:\ part. Still that is not really helpful and I am out of ideas how to move up the directory structure for the target option for scp

xetra11
  • 331
  • 1
  • 2
  • 10

2 Answers2

2

Try this

scp build/libs/app.jar foo@192.68.40.41:/C:/server
Ror
  • 321
  • 3
  • 16
2

You have to use a / before the drive letter :

scp /home/ubuntu/myfile username@IP_of_windows_machine:/C:/Users/username/Desktop

Martin
  • 474
  • 1
  • 11