I need to execute multiple system commands in parallel on a remote unix machine(only through ssh) from my windows machine.
I have used paramiko module to do the ssh to the remote machine. In the same script, I have used python subprocess module to fire the commands in parallel on the remote machine.
But I am unable to do it . Could anyone please let me know how to achieve this scenario using subprocess module? or any other way to look into the problem?
My line of code where it is not working is :
processes.append(Popen(task,shell=True))
----> task is getting executed on my own windows machine and not getting executed on the remote unix machine. it gives me a error an windows error. Also I don't know whether my subprocess code will work for achieving parallel runs here.
But I am successful in achieving parallel runs with the same piece of code using subprocess module if I copy the code to the unix machine and run the script locally.
Problem comes when I am executing the code from the windows machine and doing ssh to the remote machine.
Copyright License:
Author:「user2538252」,Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.
Link to:https://stackoverflow.com/questions/17400473/parallel-execution-of-multiple-system-commands-on-a-single-unix-host-from-window