--- title: nice and ionice keywords: [linux, unix, nice, ionice, tip, howto, job scheduling] --- You can reduce the impact of a job by combining these two commands: 1. `nice` modify the cpu scheduling of a command. Nicenesses range from -20 (most favorable scheduling) to 19 (least favorable) 2. `ionice` modify the io scheduling class and priority of a command options: * `-c` The scheduling class * 1 for real time * 2 for best-effort * 3 for idle * `-n` The scheduling class data. This defines the class data, if the class accepts an argument. For real time and best-effort, 0-7 is valid data * `-p` Pass in a process pid to change an already running process. If this argument is not given, ionice will run the listed program with the given parameters I have used the below command on my own servers and it works well: ``` bash /usr/bin/nice -n 19 /usr/bin/ionice -c2 -n7 /usr/local/bin/backup.sh ``` These articles may also be of help: * [reduce load of backup scripts](http://www.faqforge.com/linux/reduce-load-of-backup-scripts-with-nice-and-ionice/) * [set io scheduling](http://www.cyberciti.biz/tips/linux-set-io-scheduling-class-priority.html)