Replaying terminal sessions with scriptreplay
OK, this is so cool and sexy, I really don't understand how I didn't find about this earlier. Possibly because it's the recent add-on to the well known script utility?
So, I suppose you all know about script. You type script, do your work, type exit, and you have your complete session logged in the file named typescript. Quite handy if you want to log everything you did in the shell for whatever reasons.
What you might not know is that script has an interesting switch which allows you to also save the exact timing data of the screen output you're capturing. And an additional utility called scriptreplay which can later replay your session in real-time. Like a movie. With perfect timing.
It works like this:
% script -t 2> demo.timing -a demo.session
Script started, file is demo.session
% <do something>
% exit
Script done, file is demo.session
And later you replay your session like this:
% scriptreplay demo.timing demo.session
This looks like a perfect tool for short tutorials of things that need to be done in the shell prompt. To check this fact, I've attached session of a small tutorial, how to enable process accounting in Ubuntu, find it attached below (only 2KB download). Unpack it and run like this:
% tar xvzf acct-scriptreplay.tgz
% scriptreplay acct.timing acct.session
What do you think? Is it useful?
| Attachment | Size |
|---|---|
| acct-scriptreplay.tgz | 2 KB |
- linportal's blog
- Add new comment
- 15012 reads





bash recording
Hi, this has been extremely helpful.
Thank you!
R.
Window Session Replay
Finally an enterprise scale Window Session recording solution is also available for microsoft windows OS. check ObserveIT at www.observeit-sys.com
You can even "share" your
You can even "share" your bash session by using a FIFO file
On the same machine :
user 1 :
$ mkfifo /tmp/file
user 2 :
$ cat /tmp/file
user 1 :
$ script -f /tmp/file
Now, everything done by user 1 in the terminal will be output to user 2 terminal.
Any idea how to...
Any idea how I could get script to automatically start recording each time you log in? Let's say I want to monitor what users are doing or have done when they log in to the server via ssh, is there a way I could get script to automatically start recording? Thanks.
Great tips
Fantastic, although script was installed in my system, but I never discover that until I read your post. Thanks.
That happened for me also.
That happened for me also. this was really helpful.
Yeah, my sentiments exactly.
Yeah, my sentiments exactly. :) Looking at my /usr:
% du -sm /usr
4265 /usr
Oops, soon it will not fit onto one DVD media.
God knows what other useful software lurks in there. :)