Sponsored Content
Top Forums Shell Programming and Scripting Write a scripts to kill idle user for 60 min. & email user list to admin in text file Post 302508032 by sumit30 on Friday 25th of March 2011 01:01:55 PM
Old 03-25-2011
reply

@ guto: Thank you for reply. What will be more efficient way you can suggest. Can you put it in script? Thanks again.

@ rdcwayx:
whoidle command look like below.... it gives first 15 idle users from system. 'w' command not gives pid to kill so I used whoidle.

Here are few users from system.
Code:
User         Terminal   LoginDate     Idle      PID      Location
op           pts/5      Mar 25 06:13  6:15      125922   (XTSCR1)
wk           pts/191    Mar 25 10:44  1:56      184744   (192.203.5.32)
doc          pts/178    Mar 25 11:41  1:14      128836   (192.139.4.125)
aperez       pts/149    Mar 25 11:06  1:13      284380   (192.139.4.106)
kgraff       pts/150    Mar 25 11:07  1:12      273774   (192.135.3.86)


Last edited by sumit30; 03-25-2011 at 04:26 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

user & group read/write access question

folks; I created a new users on my SUSE box and i need to give this user/group a read write access to one specific folder. here's the details: - I created new user "funny" under group "users". - I need to give this user "funny" a read/write access to another directory that is owned by "root".... (3 Replies)
Discussion started by: Katkota
3 Replies

2. UNIX for Dummies Questions & Answers

Difference between : Locked User Account & Disabled User Accounts in Linux ?

Thanks AVKlinux (3 Replies)
Discussion started by: avklinux
3 Replies

3. UNIX for Advanced & Expert Users

Send email as a different user than the user logged in

Hi I am using mailx to send email and am wondering if there is a way I can send the email from a different user than the user logged in. something like do-not-reply@xyz.com Thank you. (1 Reply)
Discussion started by: rakeshou
1 Replies

4. Shell Programming and Scripting

How to kill process after x idle min?

I need a script to kill those process id whose idle time is more than 30min plz help me (3 Replies)
Discussion started by: salil2012
3 Replies

5. Homework & Coursework Questions

[Scripting]Find & replace using user input then replacing text after

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: (o) Checkout an auto part: should prompt the user for the name of the auto part and borrower's name: Name:... (2 Replies)
Discussion started by: SlapnutsGT
2 Replies

6. Shell Programming and Scripting

User idle time and kill

Hello.. I have many sleepy users on my Solaris box and need to kill them if they are idle for more than 45 minutes for example...I know who -u gives and the idle time but unable to make a awk line to get the condition perfect. Please help...:wall: (9 Replies)
Discussion started by: wimaxpole
9 Replies

7. Shell Programming and Scripting

Script to Send Email to a user when an admin kills process

Can anyone create or give me a script that I can use to email a user automatically when I kill one of their processes? Or Can you give me a script to allow me to email a user (entering email manually) when a process is killed? Like showing what the PID was and a reason the admin killed it? Is... (2 Replies)
Discussion started by: JoeGazz84
2 Replies

8. Shell Programming and Scripting

set only some command & scripts permission to a particular user

hi, i am new in unix.......i am using bash and i want to create a user which has only some command and scripts permission.........is it possible? thanx (1 Reply)
Discussion started by: rakeshtomar82
1 Replies

9. Homework & Coursework Questions

Need to write a script user.sh that parses name & password

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Write a script called user.sh that parses the name and password of given in a file (user.txt) and creates the user... (1 Reply)
Discussion started by: Nygenesis
1 Replies

10. UNIX for Dummies Questions & Answers

Deletion of list of user based on a text file In LDAP UNIX server

Dear All, It would be really nice, if you could help me to write a script for deletion of list of user( more than 15000 users) stored in a file and sorted by email address( i need deletion of only a particular type of mail address). Is the any script to write and take the file as input and... (3 Replies)
Discussion started by: Chand
3 Replies
PTS_REMOVEUSER(1)					       AFS Command Reference						 PTS_REMOVEUSER(1)

NAME
pts_removeuser - Removes a user from a Protection Database group SYNOPSIS
pts removeuser -user <user name>+ -group <group name>+ [-cell <cell name>] [-noauth] [-localauth] [-force] [-help] pts rem -u <user name>+ -g <group name>+ [-c <cell name>] [-n] [-l] [-f] [-h] DESCRIPTION
The pts removeuser command removes each user or machine named by the -user argument from each group named by the -group argument. To add users to a group, use the pts adduser command. To list group membership, use the pts membership command. To remove users from a group and delete the group's entry completely in a single step, use the pts delete command. CAUTIONS
AFS compiles each user's group membership as he or she authenticates. Any users who have valid tokens when they are removed from a group retain the privileges extended to that group's members until they discard their tokens or reauthenticate. OPTIONS
-name <user name>+ Specifies the name of each user entry or the IP address (complete or wildcard-style) of each machine entry to remove. -group <group name>+ Names each group from which to remove members. -cell <cell name> Names the cell in which to run the command. For more details, see pts(1). -force Enables the command to continue executing as far as possible when errors or other problems occur, rather than halting execution at the first error. -help Prints the online help for this command. All other valid options are ignored. -localauth Constructs a server ticket using a key from the local /etc/openafs/server/KeyFile file. Do not combine this flag with the -cell or -noauth options. For more details, see pts(1). -noauth Assigns the unprivileged identity anonymous to the issuer. For more details, see pts(1). EXAMPLES
The following example removes user smith from the groups "staff" and "staff:finance". Note that no switch names are necessary because only a single instance is provided for the first argument (the username). % pts removeuser smith staff staff:finance The following example removes three machine entries, which represent all machines in the ABC Corporation network, from the group "bin-prot": % pts removeuser -user 138.255.0.0 192.12.105.0 192.12.106.0 -group bin-prot PRIVILEGE REQUIRED
The required privilege depends on the setting of the fifth privacy flag in the Protection Database for the group named by the -group argument (use the pts examine command to display the flags): o If it is the hyphen, only the group's owner and members of the system:administrators group can remove members. o If it is lowercase "r", members of the group can also remove other members. (It is not possible to set the fifth flag to uppercase "R".) SEE ALSO
pts(1), pts_adduser(1), pts_examine(1), pts_membership(1), pts_setfields(1) COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved. This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell. OpenAFS 2014-04-08 PTS_REMOVEUSER(1)
All times are GMT -4. The time now is 09:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy