--bwlimit how to

trevor@tecnopolis.ca trevor@tecnopolis.ca
Tue, 3 Sep 2002 06:52:02 -0500 (CDT)


I read in the archives how people wanted a rsync-like --bwlimit option.
I too wanted it, but am split on whether I agree with the author that it
should be done outside of rdiff-backup.  Theoretically he's probably
correct, but practically most people will never figure out how to use
cstream or the like.

So I'm writing this email to say that I did get cstream to work with
rdiff to emulate a --bwlimit type option.  cstream is a breeze to
compile and install.

Here's the command that gets executed by my scripts:

(must run from a bsh-type shell, not a csh type)

rdiff-backup --exclude-filelist-stdin --checkpoint-interval 10
  --include '/mnt/backup/$share{path}' --exclude '/mnt/backup' ";
  --remote-schema
    'ssh %s '\''rdiff-backup --server'\'' | cstream -v 1 -t 10000'
  'netbak@foo.bar.com::/mnt/backup' localbakdir

(my script pipes in files to exclude on stdin)


Basically, the magic specifically related to bwlimit is to use
remote-schema that at the end pipes into "cstream -t bps" where bps is
an int bytes per second.  cstream will also provide a nice output at the
end of the pipe listing stats about the total transfer.

I've written a perl script that goes through a database of remote hosts,
SMB (Windows) shares and paths, and connects to each in turn
automatically mounting and running rdiff-backup in a reliable
enterprise-level manner.  It supports elaborate, wildcard capable,
excludes.

If anyone needs consulting help on something similar, give me a shout.