I'm writing a shell script to copy gigabytes of data from directory A to directory B.
The script runs just fine, but it's absolutely eating the available resources - presumably disc read/writes?
Is there some way of throttling processes to limit their resource usage for disc / processor / ram etc?
Linux kernel has different scheduling classes for I/O. Use
ionice
command to benefit from them.For example
would run your script in
idle
class, meaning script would only get I/O time whenever no other process needs it.If you need to modify an already running process,
would do it. See
man ionice
for more information.