Results 1 to 1 of 1
Hi im having a problem with a script that my company wants to use to keep a better control for all the movements that a lot of user do in ...
- 05-18-2009 #1Just Joined!
- Join Date
- May 2009
- Posts
- 3
Script to save history across multiples users
Hi im having a problem with a script that my company wants to use to keep a better control for all the movements that a lot of user do in our servers.
what they want to accomplish with this script is to create a log in a directory called /.history for all the user with the following format: log name: machine:date
Now if for example we checked one of the log file u should be able to see the history and to keep even a better control my company wants to be able to see the time and date for all the commands kept in history.... and besides that we want to have the ability to save the logs files for multiples user across multiples session / save the history for sessions that get disconnected or hangs.
i dont know if im making myself clear with what im trying to do here o if im explain this problem in the best way possible
i attached the script were using to try to get this done or at least what i have at the moment :S
export LOGNAME PATH
shopt -s histappend
PROMPT_COMMAND='history -a
trap "clear; echo logout" 0
machine=`who -m|awk '{print $5}'|sed s/\(//|sed s/\)//`
date=date%y%m%d%H%M%S
HISTFILE=/.history/${LOGNAME}_${machine}.$date
export HISTTIMEFORMAT=' %F %T
Please any help with this will be greatly appreciated !!!!


Reply With Quote