0

I am trying to capture all my session logs into a file(s) , I am using "tee" command for doing it. However I want this as a automatic behaviour for all of my new sessions. Can anyone help me to find a way so whenever I open a new window following command get auto executed ? Additional info : I am using putty and am already aware that session can be captured from putty to my local computer. But here I am interested in capturing it to the server itself.

csh -l |tee my_session_`date +%F%T`

2 Answers2

2

You can add the command to the .bashrc file under the user's home directory.

$ echo "csh -l |tee my_session_`date +%F%T`" >> ~/.bashrc

Commands in .bashrc is executed everytime a new window is spawned.

Santosh A
  • 5,173
  • 27
  • 37
0

Have you considered ttyrec ? Allows to record TTY activity in a text file.

jderefinko
  • 647
  • 4
  • 6
  • not sure of the syntax to use it, Can you share it here ? also I tried script command and it is also working ,but the problem with script command is that it need graceful exit to store the output to a file –  Mar 23 '15 at 13:01