- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Purge Redundant logons
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-27-2008 03:41 AM
тАО03-27-2008 03:41 AM
Purge Redundant logons
I've been having an issue where there are a number of redundant sh connections left hanging on my system for a few days.This is a result of people incorrectly exiting the system.My cpu can reach 100% as a result.Is there a way of automatically purging redundant logons at the end of the day in Hp-Ux?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-27-2008 03:53 AM
тАО03-27-2008 03:53 AM
Re: Purge Redundant logons
ps -ef |grep -v daemon |grep -v PID |grep -v bAcKuP4N |grep -v ops |grep -v root |grep -v informix |grep -v lp
echo "****************************************************************"
echo "TO TOTALLY REMOVE THESE USERS "
echo " HIT ENTER, CTRL-C TO ABORT. "
echo "****************************************************************"
read nothing
ps -ef |grep -v daemon |grep -v PID |grep -v bAcKuP4N |grep -v ops |grep -v root |grep -v informix |grep -v lp | awk '{ print $2 }' > /tmp/killlist
for i in `cat /tmp/killlist`
do
kill $i
kill -9 $i
done
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-27-2008 06:08 AM
тАО03-27-2008 06:08 AM
Re: Purge Redundant logons
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-27-2008 06:11 AM
тАО03-27-2008 06:11 AM
Re: Purge Redundant logons
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-27-2008 11:42 PM
тАО03-27-2008 11:42 PM
Re: Purge Redundant logons
You can do that by: $ id -gn name
ps -ef | fgrep -v PID | while read user pid dummy ; do
if [ $(id -ng $user) != "goodgrp" ]; then
echo $pid
fi
done
You can also optimize the greps by:
ps -ef |grep -v -e daemon -e PID -e bAcKuP4N -e ops -e root -e informix -e lp
You can also put these in a file:
ps -ef | grep -v -f good-guys