Search code examples
linuxscheduling

Scheduling in Linux: run a task when computer is idle (= no user input)


I'd like to run Folding@home client on my Ubuntu 8.10 box only when it's idle because of the program's heavy RAM consumption.

By "idle" I mean the state when there's no user activity (keyboard, mouse, etc). It's OK for other (probably heavy) processes to run at that time since F@H has the lowest CPU priority. The point is just to improve user experience and to do heavy work when nobody is using the machine.

How to accomplish this?


Solution

  • When the machine in question is a desktop, you could hook a start/stop script into the screensaver so that the process is stopped when the screensaver is inactive and vice versa.