Skip to content
Snippets Groups Projects
Commit ea468148 authored by micah's avatar micah :speech_balloon:
Browse files

Add Jamie McClelland's cstream patches

parent 1727edae
Branches
Tags
No related merge requests found
...@@ -19,5 +19,5 @@ Daniel.Bonniot@inria.fr ...@@ -19,5 +19,5 @@ Daniel.Bonniot@inria.fr
Brad Fritz <brad@fritzfam.com> -- trac patch Brad Fritz <brad@fritzfam.com> -- trac patch
garcondumonde@riseup.net garcondumonde@riseup.net
Martin Krafft madduck@debian.org -- admingroup patch Martin Krafft madduck@debian.org -- admingroup patch
Anarcat Anarcat -- lotsa patches
Jamie McClelland - cstream patches
...@@ -62,6 +62,7 @@ vservers = no ...@@ -62,6 +62,7 @@ vservers = no
# SLAPCAT=/usr/sbin/slapcat # SLAPCAT=/usr/sbin/slapcat
# LDAPSEARCH=/usr/bin/ldapsearch # LDAPSEARCH=/usr/bin/ldapsearch
# RDIFFBACKUP=/usr/bin/rdiff-backup # RDIFFBACKUP=/usr/bin/rdiff-backup
# CSTREAM=/usr/bin/cstream
# MYSQL=/usr/bin/mysql # MYSQL=/usr/bin/mysql
# MYSQLHOTCOPY=/usr/bin/mysqlhotcopy # MYSQLHOTCOPY=/usr/bin/mysqlhotcopy
# MYSQLDUMP=/usr/bin/mysqldump # MYSQLDUMP=/usr/bin/mysqldump
......
...@@ -13,6 +13,13 @@ ...@@ -13,6 +13,13 @@
## default is yes. set to no to skip the test if the remote host is alive ## default is yes. set to no to skip the test if the remote host is alive
# testconnect = no # 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 ## source section
## (where the files to be backed up are coming from) ## (where the files to be backed up are coming from)
......
...@@ -64,11 +64,19 @@ function check_consistency() { ...@@ -64,11 +64,19 @@ function check_consistency() {
fi 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 ### ### GET CONFIG ###
getconf options getconf options
getconf testconnect yes getconf testconnect yes
getconf nicelevel 0 getconf nicelevel 0
getconf bwlimit
setsection source setsection source
getconf type; sourcetype=$type getconf type; sourcetype=$type
...@@ -167,6 +175,19 @@ if [ $test = 0 ]; then ...@@ -167,6 +175,19 @@ if [ $test = 0 ]; then
fi fi
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 ### ### EXECUTE ###
execstr="$RDIFFBACKUP $options --print-statistics " execstr="$RDIFFBACKUP $options --print-statistics "
......
...@@ -445,6 +445,7 @@ getconf usecolors "yes" ...@@ -445,6 +445,7 @@ getconf usecolors "yes"
getconf SLAPCAT /usr/sbin/slapcat getconf SLAPCAT /usr/sbin/slapcat
getconf LDAPSEARCH /usr/bin/ldapsearch getconf LDAPSEARCH /usr/bin/ldapsearch
getconf RDIFFBACKUP /usr/bin/rdiff-backup getconf RDIFFBACKUP /usr/bin/rdiff-backup
getconf CSTREAM=/usr/bin/cstream
getconf MYSQLADMIN /usr/bin/mysqladmin getconf MYSQLADMIN /usr/bin/mysqladmin
getconf MYSQL /usr/bin/mysql getconf MYSQL /usr/bin/mysql
getconf MYSQLHOTCOPY /usr/bin/mysqlhotcopy getconf MYSQLHOTCOPY /usr/bin/mysqlhotcopy
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment