start winscp from unix

Advertisement

swyy
Joined:
Posts:
1

start winscp from unix

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?

Reply with quote

Advertisement

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.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,226
Location:
Prague, Czechia

Re: start winscp from unix

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

Reply with quote

cprasad111
Joined:
Posts:
5
Location:
singapore

run winscp from unix (it works for putty)

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

Reply with quote

cprasad111
Joined:
Posts:
5
Location:
singapore

found the answer

....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'

Reply with quote

Advertisement

You can post new topics in this forum