Page 1 of 1

Use pscp to push chosen file to a linux server

Posted: 31 May 2018 18:15
by dark green
Something I have to do many times per day is move python files to a linux machine to run.

if $FILE is the chosen file the command I use for this is

Code: Select all

pscp $FILE username@192.168.1.101:directoryname
doing this does require me to enter a password at the command line

Can I set this up as a catalog item for drag and drop? Or alternately as a right-click option?

I tried this as a script for the catalog:

Code: Select all

C:\Program Files\PuTTY\pscp.exe <curname> username@192.168.1.101:directoryname
But it doesn't work and when I try running it as a raw script I get "Overflow 0/0"

I think there's something fundamental I am misunderstanding. Can I use the catalog items to run a command line?

Re: Use pscp to push chosen file to a linux server

Posted: 31 May 2018 18:44
by highend

Code: Select all

run """C:\Program Files\PuTTY\pscp.exe"" ""<curitem>"" ""username@192.168.1.101:directoryname""";

Re: Use pscp to push chosen file to a linux server

Posted: 31 May 2018 18:50
by dark green
Hi highend. That looks very promising. Doesn't run as a catalog item, can you tell me where you intend that to be used?

Re: Use pscp to push chosen file to a linux server

Posted: 31 May 2018 18:53
by highend
Mh, it runs as a catalog item here (drag and drop)?

Show a screenshot of the properties of this entry in the catalog...

Apart from that, for multiple files at once:

Code: Select all

    $items = replace(<selitems>, '"', '""');
        run """C:\Program Files\PuTTY\pscp.exe"" $items ""username@192.168.1.101:directoryname""";

Re: Use pscp to push chosen file to a linux server

Posted: 31 May 2018 19:03
by dark green
I'm probably missing something you would consider obvious. At my end I can't even drag a file onto the catalog item, it gives the line-through-circle indicating it isn't a valid operation. Here is an image of the properties.

Image

Re: Use pscp to push chosen file to a linux server

Posted: 31 May 2018 19:56
by highend
The "Action on click" must be set to "Go to Location"

Re: Use pscp to push chosen file to a linux server

Posted: 31 May 2018 20:03
by dark green
Okay, I got it running. Thanks!
Update: Also, I sent Paypal to you, thanks for the help!

Re: Use pscp to push chosen file to a linux server

Posted: 31 May 2018 21:07
by highend
Just seen it. Thanks! :beer: