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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need help with my unix script

Status
Not open for further replies.

barakat

Programmer
Feb 25, 2002
2
US
I'm trying to write a script to do :
identify users who have been logged in for 30
minutes with no activity at their terminal. need this
script to run at 11:00 pm, and warn the user
about 5 minutes before i log them off.
 
I doubt that you want to reinvent the wheel. Depending on your Unix, you probably already have such a utility and just don't realize it.

From How can inactive users be automatically logged out?

The "idleout" program has been included with SCO Unix versions since Xenix. It is a shell script, so you can easily modify it if it doesn't quite answer your needs.

There are some limitations to it, however, so you may want to use something else.

A better program is nidleout
(ftp://ftp.armory.com/pub/admin/nidleout)
by John Dubois. That's a ksh script- it's complicated, though, and probably hard to modify unless you understand ksh scripts very well. However, it may do exactly what you want without modification.

It's possible that just setting the TMOUT variable in ksh or bash may be enough for your needs; see the man pages for your shell.

Linux has "autolog", and a compiled OSR5 version (complete with man pages) is available from
There are also commercial solutions. Computronics Logmon is product that doesn't have the limitations of idleout and offers extensive configuration capability.
Finally, I have a Perl script that has its own way of approaching the problem:
Tony Lawrence
SCO Unix/Linux Resources tony@pcunix.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top