Copy a file via SCP to target but move directory structure upwards?

ng flag

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@

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@\..\server

But it failed cause the script could not find the directory

I then tried to be absolute

scp build/libs/app.jar foo@\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

om flag

Try this

scp build/libs/app.jar foo@
cn flag

You have to use a / before the drive letter :

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

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.