Share the post "history log"
local1.notice /var/log/historycmd.log
function history_to_syslog { declare command remoteaddr=”`who am i`” command=$(fc -ln -0) if [ “$command” != “$old_command” ]; then logger -p local1.notice -t bash -i ? “$USER : $remoteaddr” : “$command” fi old_command=$command } trap history_to_syslog DEBUG
Your email address will not be published. Required fields are marked *
Comment
Name *
Email *
Website
function history_to_syslog {
declare command
remoteaddr=”`who am i`”
command=$(fc -ln -0)
if [ “$command” != “$old_command” ]; then
logger -p local1.notice -t bash -i ? “$USER : $remoteaddr” : “$command”
fi
old_command=$command
}
trap history_to_syslog DEBUG