4 ms·
I go one big step further than this and log everything that comes across the screen. One time it saved me from a crontab -r that wiped out a 100+ line crontab.
by gdulli 10y ago
I go one big step further than this and log everything that comes across the screen.
One time it saved me from a crontab -r that wiped out a 100+ line crontab. I had viewed it recently so I just copied it out of my history.
On a day to day basis it's more about looking up old queries I typed out, the results of those queries at that time, bash commands and their results, the state of a file I edited at a certain time, a stack trace, the output of an ls -l command, etc. Anything I ever do in a session.
Some of those have their own logs or ways to capture history, but a way to capture everything at once is much more comprehensive and less sensitive to forgetting to set the size of the bash history on a given machine, archiving the bash/psql history files when a machine goes away, etc.
And besides not having to worry about the availability of distributed history/log data, being able to grep everything at once is invaluable.
- szymon_k 10y agoCould you share a gist of that? Would love similar thing in my toolset!
- tetraodonpuffer 10y agonot the OP, but this discussion might be helpful http://unix.stackexchange.com/questions/25639/how-to-automatically-record-all-your-terminal-sessions-with-script-utility http://unix.stackexchange.com/questions/25639/how-to-automat... I have been wondering about doing something like this as well
- gdulli 10y agoI don't do it with code, it's a feature of this product: https://www.vandyke.com/products/securecrt/ https://www.vandyke.com/products/securecrt/
- thro1237 10y agoHow do you do this?
- gdulli 10y agoSession logging with this client: https://www.vandyke.com/products/securecrt/ https://www.vandyke.com/products/securecrt/
- jlgaddis 10y agoThis could be done using script as well.
- pnewman3 10y agoscript gives you the whole console, including output and control characters. It's a useful tool but might be a little overkill for keeping track of what commands you have run.
- SEJeff 10y agoinstall rootsh and set that to your shell. Set the logging directory to something in ~/ with 0600 perms, and away you go!