Operating System - HP-UX
1837523 Members
3501 Online
110117 Solutions
New Discussion

Re: who can help me on sell script?

 
lin.chen
Frequent Advisor

who can help me on sell script?

Could you give me a sample?
Use "w" to find the idle user(more than 2 hr)
and clear it included the process it generates?

Could you provide a shell script for this?
Best Regards,

chen lin
4 REPLIES 4
Sandman!
Honored Contributor

Re: who can help me on sell script?

# w | awk 'NR>1 {if($3)t=x[split($3,x,"m")];h=z[split(t,z,":")-1];if(h>120) print $0}'
Aussan
Respected Contributor

Re: who can help me on sell script?

this link should help you out

http://www.context-switch.com/reference/exscripts/korn/timedkill


P.S you had another posting asking the same question
The tongue weighs practically nothing, but so few people can hold it
John Guster
Trusted Contributor

Re: who can help me on sell script?

logout users idling over 2 hours can be done by set up TIMEOUT value in /etc/profile. Just as FYI.
OldSchool
Honored Contributor

Re: who can help me on sell script?

be aware that the timeout value only works if they are sitting at a shell prompt. if they've started an application and walked away, it won't work.....