Topic "multiple -cmds for external application"

Author Message
amokwao
[View user's profile]

Joined: 2016-11-16
Posts: 6
Location: USA
Hi
I would like to send multiple cmds when I lunch kitty using the "Open session in Putty". This is what I have:

Code:
D:\Dropbox\pAPPS\ssh\kitty.exe -load winSCp -cmd "cd '!/'" !U@!@ -cmd  "qsub -I -X -l nodes=2:ppn=4,walltime=2:00:00"


This works fine but after grabbing a queue I would like it to return to the current directory and load some modules like so:

Code:
D:\Dropbox\pAPPS\ssh\kitty.exe -load winSCp -cmd "cd '!/'" !U@!@ ; "qsub -I -X -l nodes=2:ppn=4,walltime=2:00:00" ; cd "cd '!/'" ; "module load matlab"


I have tried adding semicolons (like above) and -cmd to the different commands but none seem to work.
Thank you.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26504
Location: Prague, Czechia
This should work:

Code:
D:\Dropbox\pAPPS\ssh\kitty.exe -load winSCp !U@!@  -cmd "cd '!/' ; qsub -I -X -l nodes=2:ppn=4,walltime=2:00:00 ; cd '!/' ; module load matlab"


Though combining the -load and !U@!@ does not look correct either.
amokwao
[View user's profile]

Joined: 2016-11-16
Posts: 6
Location: USA
Thank you, The last cd '!/' does not seem to work after the qsub. Also the module load. Could it be something at the machine level?
Thanks


martin wrote:
This should work:

Code:
D:\Dropbox\pAPPS\ssh\kitty.exe -load winSCp !U@!@  -cmd "cd '!/' ; qsub -I -X -l nodes=2:ppn=4,walltime=2:00:00 ; cd '!/' ; module load matlab"


Though combining the -load and !U@!@ does not look correct either.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26504
Location: Prague, Czechia
What happens if you execute the command in SSH terminal? The exactly same command, just with the !/ replaced with real paths.
amokwao
[View user's profile]

Joined: 2016-11-16
Posts: 6
Location: USA
Got the same results. Grabs the nodes and returns to the home directory and does not execute the next cd or the module load.
Thanks.


martin wrote:
What happens if you execute the command in SSH terminal? The exactly same command, just with the !/ replaced with real paths.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26504
Location: Prague, Czechia
Doesn't the qsub start a new sub-shell?
amokwao
[View user's profile]

Joined: 2016-11-16
Posts: 6
Location: USA
martin wrote:
Doesn't the qsub start a new sub-shell?


Yes it does. That's why I need to cd back into the current directory. Is there a way to stop that?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26504
Location: Prague, Czechia
amokwao wrote:
Yes it does. That's why I need to cd back into the current directory. Is there a way to stop that?

That's not a question for WinSCP. Is do not know qsub. What is it?
amokwao
[View user's profile]

Joined: 2016-11-16
Posts: 6
Location: USA
martin wrote:
amokwao wrote:
Yes it does. That's why I need to cd back into the current directory. Is there a way to stop that?

That's not a question for WinSCP. Is do not know qsub. What is it?


qsub is used to submit batch jobs to our uni's supercomputers. with qsub -I, I ask it to get me a node so I can work on it interactively. That's the only way they allow us to use cpu intensive programs like matlab. When I use winSCP to launch kitty i have to do it every time I lose connection or something. I'm lazy Mr. Green and don'w want to qsub bla bla bla 20 times a day.

Thanks
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26504
Location: Prague, Czechia
Then probably the only way it to really automate multiple "lines" (with "Enter" in between). But I'm not sure if that's possible with KiTTY -cmd switch. No longer WinSCP question, sorry.
amokwao
[View user's profile]

Joined: 2016-11-16
Posts: 6
Location: USA
Got it working by adding \n between the commands. Thank you.
Advertisements

You can post new topics in this forum






Search

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