Topic "start winscp from unix"

Author Message
swyy
[View user's profile]

Joined: 2012-02-22
Posts: 1
I want the resulting file on unix server transferred over to Windows, how can I start winscp from unix at the completion of the unix job?
I have script to 'get' file on pc but it requires clicking on icon..; I've also tried using scheduler but how can I 'kick'start winscp when file is available to transfer?
Advertisements
Guest




I'm using winscp 4.2.2. I can connect to a unix computer, and transfer files on to my pc. I've also created scripts that would do the same thing, ie double click the icon and the file on the unix machine will automatically appear on my desktop. I've also scheduled the script to run every min, and the file will appear on my desktop. (All these are initiated on the windows side). Is there a way, I can initiate the script on the unix side, so that as soon as I have a new file on this unix (remote computer), it will "put" it on my desktop????

Thanks for your help.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24538
Location: Prague, Czechia
swyy wrote:
I want the resulting file on unix server transferred over to Windows, how can I start winscp from unix at the completion of the unix job?
I have script to 'get' file on pc but it requires clicking on icon..; I've also tried using scheduler but how can I 'kick'start winscp when file is available to transfer?

No.

But you can schedule script to run say every 10 minutes and check, if the file isa already available.
_________________
Martin Prikryl
cprasad111
[View user's profile]

Joined: 2012-09-25
Posts: 5
Location: singapore
I have a script in unix that i use to run task in windows by remote invoking
eg(command written in unix): myscript windows_IP_address "command to be executed"
eg of "command to be execute": d:\\a.cmd or echo d:\\a.txt etc. and it works

similarly i want to invoke and run winscp the same way and transfer file from windows to unix
what i tried:
$ myscript windows_IP_address 'd:\\blah\\blahWinSCP.com unix_user@unix_IP /hostkey "sh-rsa 1024 xx:xxx:xx:xx" /command put "d:\\blah\\blah\\a.txt" /tmp/blah/a.txt'

$ myscript windows_IP_address 'd:\\blah\\blahWinSCP.com unix_user@unix_IP -hostkey="sh-rsa 1024 xx:xxx:xx:xx" /command put "d:\\blah\\blah\\a.txt" /tmp/blah/a.txt'

$ myscript windows_IP_address 'd:\\blah\\blahWinSCP.com unix_user@unix_IP /privatekey "address ofprivate key" /command put "d:\\blah\\blah\\a.txt" /tmp/blah/a.txt'

i have tried all the combinations of the combinations of private key and hostkey

this works from windows: d:\\blah\\blahWinSCP.com unix_user@unix_IP /command put "d:\\blah\\blah\\a.txt" /tmp/blah/a.txt <<where the private key is taken from pageant; but in unix i have to provide the private key file location>>


the same syntax work for Putty, there the key is given by the token: -i "address of primary key file"

is there any way to give the address of private key file or hosteky or anything that can work
cprasad111
[View user's profile]

Joined: 2012-09-25
Posts: 5
Location: singapore
....SOLVED....

after trying some permutations and combinations of the syntax given in the documentation, I was able to specify the private key file location in the command line itself. And it ran successfully. No need to specify the hostkey (atleast in my case). The code was tested while pageant of putty was off to prevent taking the private key from there.

The command was written in windows command prommpt
winscp.com user@server_ip_address /command put readme.txt /path/path1/readme.txt /privatekey=path_of_private_key\mani.ppk

The command was written in unix machine
my_script_to_invoke_window_jobs windwo_ip_address 'path_of_winscp.com\\WinSCP.com user@unix_ip_address /command "put path_of_file_in_windows\\r.txt /path_of_file_in_unix/t.txt" /privatekey=path_of_private_key\mani.ppk'
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