diff options
-rwxr-xr-x | bin/ftpsync | 8 | ||||
-rw-r--r-- | etc/ftpsync.conf.sample | 5 |
2 files changed, 11 insertions, 2 deletions
diff --git a/bin/ftpsync b/bin/ftpsync index 580a80f..c489581 100755 --- a/bin/ftpsync +++ b/bin/ftpsync @@ -12,7 +12,7 @@ set -E # Based losely on a number of existing scripts, written by an # unknown number of different people over the years. # -# Copyright (C) 2008,2009 Joerg Jaspert <joerg@debian.org> +# Copyright (C) 2008,2009,2010 Joerg Jaspert <joerg@debian.org> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as @@ -277,6 +277,8 @@ RSYNC=${RSYNC:-rsync} # Rsync filter rules. Used to protect various files we always want to keep, even if we otherwise delete # excluded files RSYNC_FILTER=${RSYNC_FILTER:-"--filter=protect_Archive-Update-in-Progress-${MIRRORNAME} --filter=protect_${TRACE} --filter=protect_Archive-Update-Required-${MIRRORNAME}"} +# limit I/O bandwidth. Value is KBytes per second, unset or 0 is unlimited +RSYNC_BW=${RSYNC_BW:-0} # Default rsync options for *every* rsync call RSYNC_OPTIONS=${RSYNC_OPTIONS:-"-prltvHSB8192 --timeout 3600 --stats ${RSYNC_FILTER}"} # Options we only use in the first pass, where we do not want packages/sources to fly in yet and dont want to delete files @@ -286,6 +288,10 @@ RSYNC_OPTIONS2=${RSYNC_OPTIONS2:-"--max-delete=40000 --delay-updates --delete -- # Which rsync share to use on our upstream mirror? RSYNC_PATH=${RSYNC_PATH:-"ftp"} +# Now add the bwlimit option. As default is 0 we always add it, rsync interprets +# 0 as unlimited, so this is safe. +RSYNC_OPTIONS="--bwlimit=${RSYNC_BW} ${RSYNC_OPTIONS}" + # We have no default host to sync from, but will error out if its unset RSYNC_HOST=${RSYNC_HOST:-""} # Error out if we have no host to sync from diff --git a/etc/ftpsync.conf.sample b/etc/ftpsync.conf.sample index e6615e7..f4f1ae5 100644 --- a/etc/ftpsync.conf.sample +++ b/etc/ftpsync.conf.sample @@ -61,7 +61,7 @@ ## Use as space seperated list. ## Possible values are: ## alpha, amd64, arm, armel, hppa, hurd-i386, i386, ia64, kfreebsd-amd64, -## kfreebsd-i386, m68k, mipsel, mips, powerpc, s390, sh and sparc +## kfreebsd-i386, m68k, mipsel, mips, powerpc, s390, sh, sparc and source ## eg. ARCH_EXCLUDE="alpha arm armel mipsel mips s390 sparc" ## An unset value will mirror all architectures (default!) #ARCH_EXCLUDE="" @@ -101,6 +101,9 @@ ## BE VERY CAREFUL WHEN YOU CHANGE THE RSYNC_OPTIONS! BETTER DON'T! ## BE VERY CAREFUL WHEN YOU CHANGE THE RSYNC_OPTIONS! BETTER DON'T! +## limit I/O bandwidth. Value is KBytes per second, unset or 0 means unlimited +#RSYNC_BW="" + ## Default rsync options every rsync invocation sees. #RSYNC_OPTIONS="-prltvHSB8192 --timeout 3600 --stats --exclude Archive-Update-in-Progress-${MIRRORNAME} --exclude ${TRACE} --exclude Archive-Update-Required-${MIRRORNAME}" |