0

My first naive way would be writing the output (python script) into a file and send it via scp but given that there output is generated overtime (like inconstantly between 1s and 1 day periods) I don't think that opening a file, writing it and then sending it is the smartest way.

Is there a better way? It doesn't have to be ssh but something that does not require port-forwarding or UDP holepunching.

topkek
  • 61

1 Answers1

1

Pipes

This is not an ssh problem. Read up on shell pipe-lines. How standard-out can be piped to a 2nd processes standard-in. see https://www.youtube.com/watch?v=bKzonnwoR2I for an introduction.

If you already know this then.

Consider ssh remote-machine remote-command to be equivalent to local-command. e.g. ssh remote-machine ls gets a directory list on the remote. ls | less puts a directory listing through a pager. So ssh remote-machine ls | less will put a remote directory list through a pager.