mirror of
https://0xacab.org/liberate/backupninja.git
synced 2024-11-09 12:22:40 +01:00
Add Jamie McClelland's cstream patches
This commit is contained in:
parent
1727edae52
commit
ea468148c5
4
AUTHORS
4
AUTHORS
@ -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
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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 "
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user