How to Log all Terminal (/dev/pts/0) activities to a file?
Hi all,
I have a process that is spawned from a server process and that redirects its stdout to a console, for example /dev/pts/0 where I can watch its output. But due to this I cannot use tee or so to copy and log the output to a file as I am not the starter/owner of the process. Is there a way to either a) grab all data that is incoming to /dev/pts/0 and write it to a file? or b) create a new device /dev/myconsole which in turn writes data sent to it somehow to a file and additionally to /dev/pts/0 so that I can use this device as output device in the server application? Thanks for your suggestions :) Best regards, Janus |
I would rather make a wrapper script which will be started by that server process and this script will run your process and grab the data you need.
|
Thanks for your suggestion, but I cannot make any modifications there. I can only set the target where stdout is redirected to...
|
Can you direct the output to a file and then use tail -f to watch the file?
|
what kind of os is it? you may try to use the terminal itself to save the content (probably)?
|
OS is Debian. Actually I did not yet try what happens if I give a file path instead of a /dev/tty/. I think internally freopen() is being used for redirection. Could it really be that simple? If so shame on me :) I will try on Monday.
|
All times are GMT -5. The time now is 06:14 AM. |