Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a tool which can be instructed to pause specified processes if user uses a keyboard or mouse and to resume it in certain time after user has stopped interaction to the OS?

I would like to treat such way annoying mlocate update db, backuppc.


09.2015 I guess these useful utils bothered me 'cause my Ubuntu was in fact a server, not a desktop.

share|improve this question
up vote 7 down vote accepted

Use the ionice utility to set a command's I/O priority to idle - this way it won't hog your hard disk when you are working, potentially slowing you down.

The syntax is:

ionice -c 3 command-name
  • -c 3 sets I/O priority to idle. See man ionice for more information.
  • Don't forget to prefix sudo if the command itself requires sudo, e.g. updatedb
  • You can also use nice at the same time to set CPU priority to "idle" too, e.g.

    sudo nice -19 ionice -c 3 updatedb

Note: if the application is run via cron, you should also consider changing the scheduled time to when you least use your computer.

share|improve this answer
Thank you for that advice! That sounds promising. Going to do some tests. – zuba Aug 10 '12 at 12:06
Shouldn't nice take 19 instead of -19 ? sudo nice 19 ionice -c 3 updatedb – zuba Aug 10 '12 at 12:23
I found that /etc/cron.daily/mlocate runs updatedb.mlocate such way: /usr/bin/ionice -c3 /usr/bin/updatedb.mlocate. Is "-c3" proper param? man sais it should be "-c 3" – zuba Aug 10 '12 at 12:26
no, you need to prefix a - to the nice parameter. Only root can assign higher priority, which is...--20, say :). Either -c3 or -c 3 is fine. – izx Aug 10 '12 at 12:30
Does this also prevent the disk buffer cache from being filled? – starbeamrainbowlabs Sep 16 '15 at 16:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.