Sponsored Content
Full Discussion: Inactive Session
Top Forums UNIX for Dummies Questions & Answers Inactive Session Post 302075831 by tayyabq8 on Wednesday 7th of June 2006 05:30:30 AM
Old 06-07-2006
I'm not very good at shell programming though, you can use following code to kill users who are inactive for more than 30 minutes:
Code:
#!/bin/ksh
clear
who -u > ./aaa
grep -v "\." aaa > bbb

count=0;

while read a b c d e f g;
do
hour=$(echo $f | head -c 1)
min=$(echo $f | tail -c 3)
let minute=$hour*60+$min
if [ $minute -gt 30 ]; then
echo "KILLING USER........ :$a \n IDLE SINCE..........: $minute MINUTES"
kill -9 $g
let count=$count+1
fi
done < ./bbb
echo "\n\n TOTAL USERS KILLED..:$count\n"

You can modify this as per your requirements.

Regards,
Tayyab
 

7 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

inactive pages

hi, plz tell me, how can get the inactive pages in HP UX. bye.... (1 Reply)
Discussion started by: venkat_t
1 Replies

2. Shell Programming and Scripting

sqlplus session being able to see unix variables session within a script

Hi there. How do I make the DB connection see the parameter variables passed to the unix script ? The code snippet below isn't working properly. sqlplus << EOF user1@db1/pass1 BEGIN PACKAGE1.perform_updates($1,$2,$3); END; EOF Thanks in advance, Abrahao. (2 Replies)
Discussion started by: 435 Gavea
2 Replies

3. Shell Programming and Scripting

Hiding Directories on a Session by Session basis

Hi, Apologies if anyone has read my recent post on the same subject in the Linux forum, just thought actually the solution might more likely come from scripting. Essentially, I am trying to restrict access to directories based on the user's name AND their location on a session-by-session... (3 Replies)
Discussion started by: en7smb
3 Replies

4. Solaris

I am not able to login in gnome session and java session in Sun solaris 9& 10

I am not able to login in gnome session and java session in Sun solaris 9& 10 respectively through xmanager as a nis user, I am able to login in common desktop , but gnome session its not allowing , when I have given login credentials, its coming back to login screen, what shoul I do to allow nis... (0 Replies)
Discussion started by: durgaprasadr13
0 Replies

5. HP-UX

ssh session getting hung (smilar to hpux telnet session is getting hung after about 15 minutes)

Our network administrators implemented some sort of check to kill idle sessions and now burden is on us to run some sort of keep alive. Client based keep alive doesn't do a very good job. I have same issue with ssh. Does solution 2 provided above apply for ssh sessions also? (1 Reply)
Discussion started by: yoda9691
1 Replies

6. Shell Programming and Scripting

Determining if session is a login session

Besides 'who am i' and 'tty' what commands could be used to determine if a session is interactive as compared to a web process or cron process. Any command should work with the common unix variants. (3 Replies)
Discussion started by: jgt
3 Replies

7. Solaris

Difference between the desktop session and console session

what is the difference between desktop session and console session in solaris as i am wondering we use option -text for the former and -nowin for the later (1 Reply)
Discussion started by: kishanreddy
1 Replies
VLLOG(5)							AFS File Reference							  VLLOG(5)

NAME
       VLLog - Traces Volume Location Server operations

DESCRIPTION
       The VLLog file records a trace of Volume Location (VL) Server (vlserver process) operations on the local machine and describes any error
       conditions it encounters.

       If the VLLog file does not already exist in the /var/log/openafs directory when the VL Server starts, the server process creates it and
       writes initial start-up messages to it. If there is an existing file, the VL Server renames it to VLLog.old, overwriting the existing
       VLLog.old file if it exists.

       The file is in ASCII format. Administrators listed in the /etc/openafs/server/UserList file can use the bos getlog command to display its
       contents. Alternatively, log onto the server machine and use a text editor or a file display command such as the UNIX cat command. By
       default, the mode bits on the VLLog file grant the required "r" (read) permission to all users.

       The VL Server records operations only as it completes them, and cannot recover from failures by reviewing the file. The log contents are
       useful for administrative evaluation of process failures and other problems.

       The VL Server can record messages at three levels of detail. By default, it records only very rudimentary messages. To increase logging to
       the first level of detail, issue the following command while logged onto the database server machine as the local superuser "root".

	  # kill -TSTP <vlserver_pid>

       where <vlserver_pid> is the process ID of the vlserver process, as reported in the output from the standard UNIX ps command. To increase to
       the second and third levels of detail, repeat the command.

       To disable logging, issue the following command.

	  # kill -HUP <vlserver_pid>

       To decrease the level of logging, first completely disable it and then issue the "kill -TSTP" command as many times as necessary to reach
       the desired level.

SEE ALSO
       UserList(5), bos_getlog(8), vlserver(8)

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 							    2012-03-26								  VLLOG(5)
All times are GMT -4. The time now is 05:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy