EOFFJM
Posts: 22
Joined: Thu Jan 24, 2019 6:23 pm

Run multiple python files on different machines via ssh with batch file from windows 10

Thu Jul 25, 2019 12:09 pm

I can`t run multiple python programs saved in multiple linux machines via ssh from windows10.

I tried the following code.

Code: Select all

ssh pi@131.246.76.220 'cd folder;python3 example.py' &
ssh pi@131.246.76.221 'cd folder;python3 example.py'
The first line will work but it just stops there and won`t go to the second one.


pfletch101
Posts: 623
Joined: Sat Feb 24, 2018 4:09 am
Location: Buffalo, NY, USA

Re: Run multiple python files on different machines via ssh with batch file from windows 10

Thu Jul 25, 2019 8:31 pm

EOFFJM wrote:
Thu Jul 25, 2019 12:09 pm
I can`t run multiple python programs saved in multiple linux machines via ssh from windows10.

I tried the following code.

Code: Select all

ssh pi@131.246.76.220 'cd folder;python3 example.py' &
ssh pi@131.246.76.221 'cd folder;python3 example.py'
The first line will work but it just stops there and won`t go to the second one.
If you are trying to run the code you show at the Win10 PC's Command Line (or in a batch file) I wouldn't expect it to work. AFAICR, the Windows Command Processor does not recognize the ampersand ('&') as a 'continue immediately to the next command' instruction.

EOFFJM
Posts: 22
Joined: Thu Jan 24, 2019 6:23 pm

Re: Run multiple python files on different machines via ssh with batch file from windows 10

Thu Jul 25, 2019 9:12 pm

pfletch101 wrote:
Thu Jul 25, 2019 8:31 pm
EOFFJM wrote:
Thu Jul 25, 2019 12:09 pm
I can`t run multiple python programs saved in multiple linux machines via ssh from windows10.

I tried the following code.

Code: Select all

ssh pi@131.246.76.220 'cd folder;python3 example.py' &
ssh pi@131.246.76.221 'cd folder;python3 example.py'
The first line will work but it just stops there and won`t go to the second one.
If you are trying to run the code you show at the Win10 PC's Command Line (or in a batch file) I wouldn't expect it to work. AFAICR, the Windows Command Processor does not recognize the ampersand ('&') as a 'continue immediately to the next command' instruction.
Thanks. I solved it by just creating 2 batch files that would connect and run the programs on 2 machines. Then another batch file to run those 2 batch files.

Return to “Troubleshooting”