I have left a script running on a remote machine from when I was locally working at it. I can connect over SSH to the machine as the same user and see the script running in ps
.
$ ps aux | grep ipcheck
myuser 18386 0.0 0.0 18460 3476 pts/0 S+ Dec14 1:11 /bin/bash ./ipchecker.sh
It is simply outputting to stdout on a local session (I ran ./ipchecker.sh
form a local terminal window, no redirection, no use of screen
etc).
Is there anyway from an SSH session I can view the output of this running command (without stopping it)?
So far the best I have found is to use strace -p 18386
but I get hordes of text flying up the screen, its far too detailed. I can stop strace
and then sift through the output and find the text bring printed to stdout but its very long and confusing, and obviously whilst it's stopped I might miss something. I would like to find a way to see the script output live as if I was working locally.
Can anyone improve on this? The obvious answer is to restart the script with redirection or in a screen
session etc, this isn't a mission critical script so I could do that. Rather though, I see this as a fun learning exercise.
strace -p 4232 -e write