I want to do a large disk transfer, which slows down responsiveness of my system.
What I want is a Unix command that will only run the command after I have been idle at the console for a few minutes. And if I come back half way in, it will suspend the job. Until I walk away from my computer.
Is there such a command, or software package?
[edit: The key part of this question is how to determine if there is console activity, to automatically suspend.]
You can achieve this by first getting the process PID with:
write down the PID (it's the second column), then suspend it with:
and continue it with:
How about just running the command normally, and then using "nice" on it to lower its priority?
I once wrote a "pause_io" script that would accept a number and then pgrep all the types of things that are likely to whomp my IO, e.g. rsync, updatedb, and cp. Then it would kill -STOP those pids and sleep for the supplied number of minutes and then kill -CONT each of them. When I needed responsive access to the box I would execute
And I would have 10 minutes without heavy I/O
It went something like this:
rsync
has a--bwlimit
option.Run the suggested -STOP and -CONT as part of some screen-saver maybe?
(If you're on a terminal: There's also a screen-saver for terminals, but I don't know its name, or where to set its options. All I know is, that it's on by default on Ubuntu :-)