Logging console output using screen and tee


New Member

I have a need to set up console logging for some bits of equipment. We use a console router so the format for connecting is:

ssh <user>:<line number>@<console router fqdn>

I want to log the output so I am actually using:

ssh <user>:<line number>@<console router fqdn> | tee <filename>.txt

The above works as expected.

Because there are a number of bits of equipment I want to use 'screen' to open up a bunch of windows (with the plan of putting this into a simple script once it works):

screen ssh user:[email protected] | tee line-8-console.txt

This works in that I get the login screen for the console router, and then can log into the device, and the file line-8-console.txt is created - but the file is empty. I don't really understand what is wrong, I guess there's something funky permissions-wise about 'screen' writing to the file? Can anyone help?


Members online