diff options
author | Micah Anderson <micah@riseup.net> | 2006-12-15 23:13:47 +0000 |
---|---|---|
committer | Micah Anderson <micah@riseup.net> | 2006-12-15 23:13:47 +0000 |
commit | ea468148c55ce56e0c106f7e98ed249f8ffb388c (patch) | |
tree | a87d9c9f2c5dbe6118fbdb2a40619ff02eec8edd /handlers | |
parent | 1727edae52095f3d4724120bb3eae7022132efec (diff) | |
download | backupninja-ea468148c55ce56e0c106f7e98ed249f8ffb388c.tar.gz backupninja-ea468148c55ce56e0c106f7e98ed249f8ffb388c.tar.bz2 |
Add Jamie McClelland's cstream patches
Diffstat (limited to 'handlers')
-rw-r--r-- | handlers/rdiff | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/handlers/rdiff b/handlers/rdiff index bdc1cbd..5561435 100644 --- a/handlers/rdiff +++ b/handlers/rdiff @@ -64,11 +64,19 @@ function check_consistency() { fi } +function check_cstream() { + local cstream=$1 + if [ ! -x $cstream ]; then + fatal "Can't find your cstream binary (trying: $cstream). If you use bwlimit you must have cstream installed." + fi +} + ### GET CONFIG ### getconf options getconf testconnect yes getconf nicelevel 0 +getconf bwlimit setsection source getconf type; sourcetype=$type @@ -167,6 +175,19 @@ if [ $test = 0 ]; then fi fi +# Add cstream + +if [ ! -z $bwlimit ]; then + check_cstream $CSTREAM; + if [ "$desttype" = "remote" ]; then + RDIFFBACKUP="$RDIFFBACKUP --remote-schema 'cstream -t $bwlimit | ssh %s \''rdiff-backup --server\'''" + elif [ "$sourcetype" = "remote" ]; then + RDIFFBACKUP="$RDIFFBACKUP --remote-schema 'ssh %s \''rdiff-backup --server\'' | cstream -t $bwlimit'" + else + fatal "You specified a bandwidth limit but neither your source nor destination types are remote." + fi +fi + ### EXECUTE ### execstr="$RDIFFBACKUP $options --print-statistics " |