LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 07-09-2005, 12:40 PM   #1
nio
Member
 
Registered: Jul 2005
Location: Netherlands
Distribution: OpenBSD, Debian Sarge, Ubuntu, FreeBSD, Gentoo Linux
Posts: 59

Rep: Reputation: 15
Question How run script after certain idle time?


Hi-ya,

I want a script to be run every time I'm idle for 10 minutes.
I want a script to be run when I become active again.
I want it to work whether I'm in the console or in X (although if I had to choose, the idle time would have to be based on X activity).

I tried to make xscreensaver run a script, but without success, first it gave me the error "test: missing argument", and lateron, I got "test: -window-id: binary operator expected", but I'd like my screen not to go blank at all, so the xscreensaver wouldn't work in this case.

The command "w" gives the idle time of shell logins, but doesn't count X idle time.

The idea originally was to set server-bandwidth to max if idle, and back to minimal when I become active again, but I'm going to try and solve that with traffic shaping techniques.

I'd like to use the idle time for cleanup scripts, backup scripts and other useful tasks.

Anyone know how to achieve this?
 
Old 07-09-2005, 02:02 PM   #2
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 56
Check out this article about idleize
http://www.pattosoft.com.au/jason/idleize/

Maybe more out there from googling linux cpu idle time.
 
Old 07-09-2005, 02:05 PM   #3
zen0n
LQ Newbie
 
Registered: Jul 2004
Location: Winnipeg
Distribution: debian
Posts: 22

Rep: Reputation: 15
What about monitoring the load on the machine? With some grep/awk magic you could run a script that would do whatever you want between certain load values.

Probably wouldn't be the most responsive as I don't think load values are continiuously updated, but its a idea.

Ryan
 
  


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
IDLE time for DSL metallica1973 Linux - Networking 0 02-22-2005 11:06 AM
reading idle time with perl/shell script daryl314 Linux - General 1 12-27-2004 01:11 PM
RH8 - how to automatically run a shell script at boot time nu-B Linux - Newbie 2 11-03-2003 02:47 PM
RH8 - how to automatically run iptables rules shell script at boot time nu-B Linux - General 1 10-29-2003 08:38 PM
i want to run a script or program at boot time!! FreakboY Linux - Newbie 9 10-12-2003 08:03 AM


All times are GMT -5. The time now is 12:48 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration