how can I execute a process on a remote machine and view the standard output before the process exits? ssh is ideal but only reports output once the remote command has completed.
an example python script like this:
#!/usr/bin/python3
import time
tStart = time.time()
elapsedTime=0
while elapsedTime<10000:
time.sleep(2)
elapsedTime = time.time() - tStart
print('elapsed time: {0:6.2f}(s)'.format(elapsedTime))
generates output indicating it's progress:
elapsed time: 2.00(s)
elapsed time: 4.00(s)
elapsed time: 6.00(s)
elapsed time: 8.00(s)
...
I'd like to run this on a remote machine with ssh:
ssh vector /home/comperem/myProc.py
This process will not end for many minutes or hours and I need to monitor the process as it runs.
How can I get ssh or something similar to run the command remotely and report stdout
to the local console as it is generated, before the remote process completes? Output after each line would be useful.