diff options
Diffstat (limited to 'etc')
-rw-r--r-- | etc/common | 11 | ||||
-rw-r--r-- | etc/ftpsync.conf.sample | 36 |
2 files changed, 41 insertions, 6 deletions
@@ -181,7 +181,7 @@ log () { # to the address configured in MAILTO (if non-empty) error () { log "$@" - if [ -z "${MAILTO}" ]; then + if [ -n "${MAILTO}" ]; then echo "$@" | mail -e -s "[$PROGRAM@$(hostname -s)] ERROR [$$]" ${MAILTO} fi } @@ -232,3 +232,12 @@ savelog() { done mv "${torotate}" "${torotate}.0" } + +# Return rsync version +rsync_protocol() { + RSYNC_VERSION="$(${RSYNC} --version)" + if [[ $RSYNC_VERSION =~ (protocol[ ]+version[ ]+([0-9]+)) ]]; then + echo ${BASH_REMATCH[2]} + fi + unset RSYNC_VERSION +} diff --git a/etc/ftpsync.conf.sample b/etc/ftpsync.conf.sample index e3f5cf5..c8750fe 100644 --- a/etc/ftpsync.conf.sample +++ b/etc/ftpsync.conf.sample @@ -104,30 +104,56 @@ ## This is *relative* to ${TO} #TRACE="project/trace/${MIRRORNAME}" +## The trace file can have different format/contents. Here you can select +## what it will be. +## Possible values are +## "full" - all information +## "terse" - basic, timestamp only (date -u) +## "touch" - just touch the file in existance +## "none" - no tracefile at all +## +## Default and required value for Debian mirrors is full. +#EXTENDEDTRACE="full" + ## We sync our mirror using rsync (everything else would be insane), so ## we need a few options set. ## The rsync program #RSYNC=rsync +## Extra rsync options as defined by the local admin. +## There is no default by ftpsync. +## +## Please note that these options are added to EVERY rsync call. +## Also note that these are added at the beginning of the rsync call, as +## the very first set of options. +## Please ensure you do not add a conflict with the usual rsync options as +## shown below. +# RSYNC_EXTRA="" + +## limit I/O bandwidth. Value is KBytes per second, unset or 0 means unlimited +#RSYNC_BW="" + ## BE VERY CAREFUL WHEN YOU CHANGE THE RSYNC_OPTIONS! BETTER DON'T! ## BE VERY CAREFUL WHEN YOU CHANGE THE RSYNC_OPTIONS! BETTER DON'T! ## 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="" +## Files that must *never* be deleted by rsync. These are files handled +## internally by ftpsync and will be created, updated, and deleted when +## appropriate. +#RSYNC_FILTER="--filter=protect_Archive-Update-in-Progress-${MIRRORNAME} --filter=protect_${TRACE} --filter=protect_Archive-Update-Required-${MIRRORNAME}" ## 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}" +#RSYNC_OPTIONS="-prltvHSB8192 --timeout 3600 --stats ${RSYNC_FILTER}" ## Options the first pass gets. We do not want the Packages/Source indices ## here, and we also do not want to delete any files yet. -#RSYNC_OPTIONS1="--exclude Packages* --exclude Sources* --exclude Release* --exclude InRelease --exclude ls-lR*" +#RSYNC_OPTIONS1="--exclude=Packages* --exclude=Sources* --exclude=Release* --exclude=InRelease --exclude=i18n/* --exclude=ls-lR*" ## Options the second pass gets. Now we want the Packages/Source indices too ## and we also want to delete files. We also want to delete files that are ## excluded. -#RSYNC_OPTIONS2="--max-delete=40000 --delay-updates --delete --delete-after --delete-excluded" +#RSYNC_OPTIONS2="--max-delete=40000 --delay-updates --delete --delete-excluded" ## You may establish the connection via a web proxy by setting the environment ## variable RSYNC_PROXY to a hostname:port pair pointing to your web proxy. Note |