Hello I am trying to capture all commands that someone who either uses 'sudo' or 'su -' to root uses. I have the following in my .baschrc file in root;
Code:
export HISTSIZE=10000
export HISTTIMEFORMAT="%F %T "
export HISTFILE=/var/log/users_historylogs/root_history-$(who am i | awk '{print $1}';exit)
export PROMPT_COMMAND='history -a'
Checking the history file I see this;
Code:
#1428434081
cat /var/log/users_historylogs/root_history-rjs
#1428434220
vi .bashrc
#1428434289
source .bashrc
#1428434292
cat /var/log/users_historylogs/root_history-rjs
#1428434391
vi .bashrc
#1428434569
source .bashrc
#1428434572
ls
As you can see I am not seeing what I would like to see and that would be the foramt of;
20150407 15:33
Or even better
20150407 1533
What is the above not working and how can I fix this?