So I'm currently sshing into a remote server and doing a job that takes a while. To monitor it I have to see the terminal output log that the program outputs. But when I detach it and come back to the server I only see the latest page of output. How can I see all the output ever since detachment? I'm using byobu to detach btw.
Thank you in advance.
-Oak
I do not know byobu but as long as it keeps the terminal open so that the program keeps running, you can do ordinary command line magic. Start the program and redirect its output to a file. You then can watch the file:
You can either run that command in the background using
&
, or you can simply open a new "virtual terminal" and issue thetail -f /tmp/some-file.log
there.You can also use
tee
so that you can keep watching the program running and, when needed, read the complete log file later on.Keep in mind that you are only redirecting
stdout
. If the program gives information onstderr
, you have to redirect that as well.