Limiting network use of a process

Hi!

I use storeBackup to make periodic backups to a USB external drive.
I use a script as root with some lines like the following.
When I began to use I didn’t use nice nor ionice, the my system seemed to hang until the backup was completed (some hours). Then I began to use nice and the system worked better but with so many disk access I was still too slow. With nice and ionice I can work very well. The command is supposed to use only idle CPU and IO slots. But my internet connection stop working
Most of my personal directories, which are being backed up are mounted through the ethernet connection from a server via NFS, so I guess the storeBackup process is using all the available network bandwith and freezing my internet connection


#!/bin/sh
ionice -c3 nice -n 19 storeBackup -s /home/maria -b /mnt/toshiba/maria --keepAll 1250d --keepMinNumber 5 --keepFirstOfYear 3650d --compress gzip -p .gz --exceptDirs .beagle --cpIsGnu  --progressReport 1000,10m

I have been searching ways of controlling network bandwidth for a process and I have found some complex methods involving use of iptables and some things more, but I have two questions

  1. Why ionice does not work with the network bandwith? I am using -c3 so storeBackup should only use any I/O (and ethernet is IO) when idle

  2. Is there any other method of controlling network bandwith for a process as simple as ionice?

regards

The standard “packet shaping” app for linux is tc which should already be installed on your system as part of the basic IPv2 tool set, eg run the following in a root console

tc --help

Manually configuring iptables and tc by hand can be complex.
I can’t recommend a specific frontend, but you may want to experiment with any you can find if you feel your needs are simple.

TSU