Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

custom gnu-screen session log filename

Tags:

gnu-screen

I'd like to know if someone has tried logging their gnu-screen session to a logfile (other than the default screenlog.N where N is the session number).

I tried doing the following

~$ screen -L custom_screenlog -S test_session

but screen would terminate. It's not also in the screen manual. Tried searching Google and I can't seem to see an answer.

Thanks.

like image 523
icasimpan Avatar asked Aug 02 '12 06:08

icasimpan


People also ask

How do you write a screen output to a file?

You can also use Ctrl + A , H to save loggings into a screenlog. n file.

How do I log a screen session in Linux?

To activate the screen logging function, just press “Ctrl-A” and “H“. (Please be careful, we use capital 'H' letters. Using non-capital 'h', will only create a screenshot of the screen in another file named hardcopy).

Where can I find screen logs?

You can find the screenlog. 0 file in screen 's current working directory (cwd). This is either the directory that was the cwd when you started screen , or it's a directory you subsequently changed to using the :chdir screen command.

What is the command used for simple use of GNU screen?

Log files of current screen sessions can be started with the Ctrl+a H command, which will make a file called screenlog. X where X is the number of your screen session. A screenshot of what is currently in your screen window can be invoked with Ctrl+a h, creating a file called hardcopy.


1 Answers

My 4.0.2 version of GNU screen has no argument to -L switch. The log file is systematically named screenlog.0 and created in the current directory. Then you may simply try:

screen -L -S test_session

Edit: you can customize your .screenrc file, adding for instance

logfile /tmp/screenlog-%Y%m%d-%c:%s

This way log files may be stored in a predefined directory (/tmp in this example) and may be named after logfile opening date

like image 101
Stephane Rouberol Avatar answered Sep 19 '22 17:09

Stephane Rouberol