UnixPedia : HPUX / LINUX / SOLARIS: HPUX :How to Activate Root logging script on the server.

Tuesday, February 12, 2013

HPUX :How to Activate Root logging script on the server.

How to Activate Root logging script on the server.

 

mkdir /.root/.histdir/

 

Enter below code in /.root/.profile

cp –p /.root/.profile /.root/.profile.$(date +%Y%m%d-%H%M%S)

 

#--------------------------------------------

EDITOR=vi

HISTSIZE=1000

USER=$(whoami)

PARID=$(ps -f -p $$ | tail -1 | awk '{print $3}')

RUSER=$(ps -f -p $PARID | tail -1 | awk '{print $1}')

HISTFILE=$HOME/.histdir/$USER.$RUSER.$(date +%Y%m%d-%H%M%S)

HOST=$(hostname)

PS1='[$USER@$HOST:$PWD]#

#-> '

 

export USER HISTFILE RUSER HOST HISTFILE HISTSIZE EDITOR PATH PS1

 

#----------------------------------------------

No comments:

Post a Comment