How run script after certain idle time?
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?
Check out this article about idleize
Maybe more out there from googling linux cpu idle time.
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.
|All times are GMT -5. The time now is 08:33 AM.|