0

Is there a way to copy a file from a server to a local folder (i.e. My Documents)? can it be done by scp?

I have this script that generate some list. I want this script to automatically copy the generated file to my windows home directory.

I tried this but it just rename the file as the folder it has to be transferred at.

scp name@some_server:/home/user/file.txt 'somehere\home\home_dir'

  • The only way I can think of that this could be done is to export a directory/file system on the server as a CIFS share, and map that CIFS share as a mapped drive within Windows. What you are asking is much more of a Windows question than Unix/Linux as it will require Windows software that will accept scp connecttions. As such you may get better answers by asking this on Super User. – Warwick Aug 6 '14 at 5:44
  • 1
    Is the script running on the Linux machine or the Windows machine? – Gilles 'SO- stop being evil' Aug 6 '14 at 22:38
2

You could install Cygwin on your Windows server. If you are trying to push files to your windows host you will need to install and setup cygwin sshd on your windows host. Or you could just pull files to your windows host.

  • Installing cygwin sshd has a clear advantage (at least in my opinion), you will be using a widely-used sofware (sshd), so getting help and tips should be easy. – Luis Antolín Cano Nov 14 '14 at 11:06
1

Other possible approach is export a windows share at your windows host (how to to that would be off-topic) and then access it from your linux host using SMB tools like smbclient.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.