Topic "Windows to Linux= :-) ---- Linux to Windows = ???"

Author Message
jwb1980
[View user's profile]

Joined: 2014-02-04
Posts: 2
If this is not the correct place to post this question I apologize in advance please just give me a link to where I should post this question. I have three tasks, 1st transfer file from a Window network share to a Linux server share. 2nd transfer files from a Linux share to a Windows share. Both need to be automated. Now I have a the Windows to Linux running smooth, no real problems there its is:

WinSCP.com /console /script=WinSCP_CMDs.txt
option batch abort
option confirm off
open sftp://username@server.com -hostkey="ssh-rsa2@22:server.com =0x23,bla bla, bunch of numbers, you get it"
lcd "\\Windows_server\Share"
cd /Linux-root/dir-path
lls
ls
synchronize remote -filemask="*.txt |*<1D ; */"
Exit




I'm guess was that the Linux to Windows transfer would be:

WinSCP.com /console /script=2ndWinSCP_CMDs.txt
option batch abort
option confirm off
open sftp://username@server.com -hostkey="ssh-rsa2@22:server.com =0x23,bla bla, bunch of numbers, you get it"
lcd /Linux-root/dir-path
cd "\\Windows_server\Share"
lls
ls
synchronize remote -filemask="*.txt |*<1D ; */"
Exit

But I'm getting the following error:
Error changing directory to '\\Windows_server\Share'.
Cannot get real path for '/Linux-root/dir-path/\\Windows_server\Share'.
No such file or directory.
Error code: 2
Error message from server: No such file
/Linux-root/dir-path


I'm assuming there is just something that I'm missing, or there is a problem with my syntax. Any and All help would be appreciated. ---Thanks in Advance
jwb1980
[View user's profile]

Joined: 2014-02-04
Posts: 2
OK this is for anyone in the future (including me Mr. Green ), I figured it out. So instead of racking my brain how to make Linux the local and Windows the remote. I just change the sync directions. It ends up like this:
option batch abort
option confirm off
open sftp://username@server.com -hostkey="ssh-rsa2@22:server.com =0x23,bla bla, bunch of numbers, you get it"
lcd /Linux-root/dir-path
cd "\\Windows_server\Share"
lls
ls
synchronize local -filemask="*.txt |*<1D ; */"
Exit
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
jwb1980 wrote:
I just change the sync directions.

That's the correct solution.
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License