Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Monitor Users Logging In 2

Status
Not open for further replies.

Germo

Technical User
Mar 29, 2004
123
GB
Hi All,

I wonder if you can help...

It maybe a simple answer but I can't seem to get my head around it..

I want to have a logfile created that will have in it all users beginning with "rt" that log into the system from lets say 00:00am to 23:59pm

Any help would be great
 
The simplest way is to add a bit to /etc/profile which loks like
Code:
case $LOGNAME in
  rt*)
    echo $LOGNAME logged in at $(date) >> /var/logs/logins;;
esac


Columb Healy
 
Thanks very much, that works a treat.
 
Why not use good old last command?
Code:
last |grep ^rt

Stefan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top