News for hackers. Stuff that matters.
Re:How and Why to Log Your Bash History by gdulli on Tuesday May 31, 2016 @11:07AM (#11806929)
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.

Re:How and Why to Log Your Bash History by szymon_k on Tuesday May 31, 2016 @11:25AM (#11807065)
Could you share a gist of that? Would love similar thing in my toolset!
Re:How and Why to Log Your Bash History by gdulli on Tuesday May 31, 2016 @12:14PM (#11807410)
I don't do it with code, it's a feature of this product: https://www.vandyke.com/products/securecrt/
Re:How and Why to Log Your Bash History by tetraodonpuffer on Tuesday May 31, 2016 @11:28AM (#11807087)
not the OP, but this discussion might be helpful

http://unix.stackexchange.com/questions/25639/how-to-automat...

I have been wondering about doing something like this as well

Re:How and Why to Log Your Bash History by thro1237 on Tuesday May 31, 2016 @11:36AM (#11807141)
How do you do this?
Re:How and Why to Log Your Bash History by gdulli on Tuesday May 31, 2016 @12:15PM (#11807413)
Session logging with this client: https://www.vandyke.com/products/securecrt/
Re:How and Why to Log Your Bash History by jlgaddis on Tuesday May 31, 2016 @01:44PM (#11808381)
This could be done using

  script
as well.
Re:How and Why to Log Your Bash History by pnewman3 on Tuesday May 31, 2016 @03:48PM (#11809586)
script 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.
Re:How and Why to Log Your Bash History by SEJeff on Tuesday May 31, 2016 @08:26PM (#11811328)
install rootsh and set that to your shell. Set the logging directory to something in ~/ with 0600 perms, and away you go!