To throttle the disk I/O rate for the rsync
tool on Linux and Unix, you can use the ionice
command. The ionice
command allows you to set the I/O priority of a process, which can be used to limit the disk I/O rate of the rsync
process.
To use ionice
, you will need to run the rsync
command with ionice
as the prefix. For example, to set the I/O priority of rsync
to the lowest priority, you can use the following command:
ionice -c 3 rsync [options] source destination
The -c
option specifies the class of I/O priority, and the value 3
specifies the lowest priority.
Alternatively, you can also use the -n
option to specify the I/O priority as a numeric value. The values range from 0 (highest priority) to 7 (lowest priority). For example, to set the I/O priority to the second-lowest priority, you can use the following command:
ionice -n 6 rsync [options] source destination
You can also use the -p
option to specify the PID of the process you want to set the I/O priority for. This can be useful if you want to set the I/O priority for an already running rsync
process. For example:
ionice -c 3 -p 12345
Replace 12345
with the actual PID of the rsync
process.