How to transfer files using WinSCP console from a remote Windows 8 Server to a Linux server?

0

1

I am currently connected to a windows server. I installed winscp on it. I run the winscp and connect to a linux server. Now on the GUI of the winscp, i clicked the console, and use the scp command. The file on the remote server is C:\xampp\htdocs\android\files\file.txt now I want to transfer it to my linux server. I'm planning to automate this using an application created in python. But the problem is my code is incorrect. To be honest I don't really get it. So please guide me.

Here is what I'm trying to do:

scp C:\xampp\htdocs\android\files\file.txt remote_server_ip_add@linux_ip_add:/home

I don't know if this is correct. It's just not working.

The user name of the remote server for example is remote_server. And the user name of the linux server for example is linux_server.

Should it be like this?

scp C:\xampp\htdocs\android\files\file.txt remote_server@linux_server:/home

I also got this error:

C: node name or service name not known

Vincent

Posted 2013-12-11T03:51:42.203

Reputation: 103

Btw, to me it looks like that the fact the Windows 8 server is "remote" is bit irrelevant to the topic (how are you "connected"? RDP?), you are just making your question confusing. – Martin Prikryl – 2013-12-11T07:43:45.187

Answers

0

If you refer to the Console window of WinSCP, you need to realize that the command executes on the remote server. While your scp syntax might work, if you had executed the command on a local machine (had you have the scp command there).

What do you want to achieve? Why are you trying to transfer file using command line, if you are in a GUI client?

Were you just testing, so that you can use the command for automation? Note that WinSCP has the put command to upload files. But you cannot issue scripting commands in GUI, you need to do it in a scripting mode. For more details see the Guide to automate file transfers to FTP server or SFTP server.

Martin Prikryl

Posted 2013-12-11T03:51:42.203

Reputation: 13 764

yes you're right im going to use the command for automation sir, sorry i can't upvote you because of lack of reputation. – Vincent – 2013-12-13T01:54:30.113

-1

It should be user_name@server_ip:filename. (Run scp without arguments to see info)

scp C:\xampp\htdocs\android\files\file.txt linux_Server@linux_ip_add:/home

BTW: Names are case sensitive - so linux_Server is not the same as linux_server , etc.

furas

Posted 2013-12-11T03:51:42.203

Reputation: 101