LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-19-2009, 05:51 AM   #1
sundalo1205
LQ Newbie
 
Registered: Nov 2007
Posts: 3

Rep: Reputation: 1
how logout old session


hi guyz!
hope you could help me out...i can't find any solution close to my problem.
i wanted to logout all users with login sessions older than 1day, how do i create a script for this? most of my users forget to logout their session properly and sometimes this session causes high cpu usage on my machine. so, i wanted to automate a script that will logout their session older than one day.
i'm not sure if i can do a simple grep of user with login session older than one day...please help.
 
Old 05-19-2009, 08:25 AM   #2
arckane
Member
 
Registered: Sep 2005
Location: UK
Distribution: Gentoo/Debian/Ubuntu
Posts: 307

Rep: Reputation: 38
Use 'who -u' to work out who is in and then use a 'date' comparison to see if it's older than a day. If so, 'kill'

Have a crack at a bash script to do this yourself first and if you get stuck shout us and we'll give you some pointers.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Save session on logout carlwilson Red Hat 1 07-08-2008 08:00 PM
vnc session is not exiting at logout marozsas Linux - Software 3 07-18-2006 03:53 PM
Unable to logout of kde session arubin Slackware 8 05-12-2006 11:22 PM
Save session on logout in Fluxbox berraf Slackware 1 12-22-2005 04:57 AM
logout gnome if the session is idle? yenonn Linux - Newbie 0 10-07-2004 01:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration