I was running a rake task as a separate process in my server and printing on STDOUT tracking the progress of that script.
While in the SSH connection, my internet connection reset. When I reestablished the connection to the server, I found that the process was still running. I want to listen to its STDOUT ouput. I have the process id.
How can I do that?
For the future, consider screen. This wonderful little tool can hold a large number of virtual terminals and let you easily switch from one to the next (without even using the mouse), but what’s best, is if you get disconnected the virtual terminals live on until you reconnect and recover the screen session.
To start a screen session:
To detach a screen session on purpose so you can disconnect and leave it running:
To reattach your detached screen session
There’s a whole lot more to it, but that’s enough to get you started.