Add Jamie McClelland's cstream patches

This commit is contained in:
Micah Anderson 2006-12-15 23:13:47 +00:00
parent 1727edae52
commit ea468148c5
5 changed files with 32 additions and 2 deletions

View File

@ -19,5 +19,5 @@ Daniel.Bonniot@inria.fr
Brad Fritz <brad@fritzfam.com> -- trac patch
garcondumonde@riseup.net
Martin Krafft madduck@debian.org -- admingroup patch
Anarcat
Anarcat -- lotsa patches
Jamie McClelland - cstream patches

View File

@ -62,6 +62,7 @@ vservers = no
# SLAPCAT=/usr/sbin/slapcat
# LDAPSEARCH=/usr/bin/ldapsearch
# RDIFFBACKUP=/usr/bin/rdiff-backup
# CSTREAM=/usr/bin/cstream
# MYSQL=/usr/bin/mysql
# MYSQLHOTCOPY=/usr/bin/mysqlhotcopy
# MYSQLDUMP=/usr/bin/mysqldump

View File

@ -13,6 +13,13 @@
## default is yes. set to no to skip the test if the remote host is alive
# testconnect = no
## default is not to limit bandwidth.
## set to a number in bytes/second to limit bandwidth usage. Use a negative
## number to set a limit that will never be exceeded, or a positive number
## to set a target average bandwidth use. cstream is required. See cstream's
## -t option for more information. 62500 bytes = 500 Kb (.5 Mb)
# bwlimit = 62500
######################################################
## source section
## (where the files to be backed up are coming from)

View File

@ -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 "

View File

@ -445,6 +445,7 @@ getconf usecolors "yes"
getconf SLAPCAT /usr/sbin/slapcat
getconf LDAPSEARCH /usr/bin/ldapsearch
getconf RDIFFBACKUP /usr/bin/rdiff-backup
getconf CSTREAM=/usr/bin/cstream
getconf MYSQLADMIN /usr/bin/mysqladmin
getconf MYSQL /usr/bin/mysql
getconf MYSQLHOTCOPY /usr/bin/mysqlhotcopy