How to Timestamp the History of Commands Used in AIX

Until AIX 5.3, one could only store what commands were run by a user. Having information on what command was run by a user ID is useful, but it is not always sufficient to conclude if that command caused a certain effect at a certain time. One needs to know WHEN a command was run as well.

The command history can be time stamped from AIX 5.3 onward, by setting the following to a user's environment:
EXTENDED_HISTORY=ON
HISTSIZE=5000

You have to make sure that a HISTSIZE (5000 shown above is an example, you can set it to a value based on you needs) is also defined when EXTENDED_HISTORY is set.

Now you could set these environment variable on each user's logon script or you can push it to all the users by adding "EXTENDED_HISTORY=ON" (without quotes) to /etc/environment and "export HISTSIZE=5000" to /etc/profile.

Remember that you won't be able to see the time stamps using history command. You can see them in .sh_history file in home directory of the user.You won't be able to see the time stamps using history command, you can see them in .sh_history file in home directory of the user.

Comments

Popular posts from this blog

OS/DB Migration - CMD. STR, TOC, EXT, R3load, DDLDBS.TPL and more

Fixing Inconsistent Table - Table activation fails due to inconsistency between DD and DB

301 Redirect Using SAP Web Dispatcher