chiark
/
gitweb
/
~mdw
/
mirror-admin
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6573673
)
bin/ftpsync: New version from upstream.
author
Mark Wooding
<mdw@distorted.org.uk>
Fri, 16 Mar 2012 11:08:59 +0000
(11:08 +0000)
committer
Mark Wooding
<mdw@distorted.org.uk>
Fri, 16 Mar 2012 11:21:45 +0000
(11:21 +0000)
bin/ftpsync
patch
|
blob
|
blame
|
history
diff --git
a/bin/ftpsync
b/bin/ftpsync
index 484789db5d2e4c2cab31f79be50e0be9a12189f3..1ae7b811c38fc02d48f2a0241e292a1348d5dcc4 100755
(executable)
--- a/
bin/ftpsync
+++ b/
bin/ftpsync
@@
-113,7
+113,7
@@
cleanup() {
SPEED=$(
SPEEDLINE=$(egrep '[0-9.]+ bytes/sec' "${LOGDIR}/rsync-${NAME}.log")
set "nothing" ${SPEEDLINE}
SPEED=$(
SPEEDLINE=$(egrep '[0-9.]+ bytes/sec' "${LOGDIR}/rsync-${NAME}.log")
set "nothing" ${SPEEDLINE}
- echo $
8
+ echo $
{8:-""}
)
if [ -n "${SPEED}" ]; then
SPEED=${SPEED%%.*}
)
if [ -n "${SPEED}" ]; then
SPEED=${SPEED%%.*}
@@
-225,10
+225,10
@@
fi
# can be used to exclude a complete architecture from #
# mirrorring. Use as space seperated list. #
# Possible values are: #
# can be used to exclude a complete architecture from #
# mirrorring. Use as space seperated list. #
# Possible values are: #
-# alpha, amd64, arm, armel,
hppa, hurd-i386, i386, ia64,
#
-# mipsel,
mips, powerpc, s390, sparc, kfreebsd-i386, kfreebsd-amd64
#
+# alpha, amd64, arm, armel,
armhf, hppa, hurd-i386, i386, ia64, mips
#
+# mipsel,
powerpc, s390, s390x, sparc, kfreebsd-i386, kfreebsd-amd64
#
# and source. #
# and source. #
-# eg. ARCH_EXCLUDE="alpha arm armel mipsel mips s390 s
parc"
#
+# eg. ARCH_EXCLUDE="alpha arm armel mipsel mips s390 s
390x sparc"
#
# #
# An unset value will mirror all architectures #
########################################################################
# #
# An unset value will mirror all architectures #
########################################################################
@@
-243,7
+243,7
@@
LOGDIR=${LOGDIR:-"${BASEDIR}/log"}
LOG=${LOG:-"${LOGDIR}/${NAME}.log"}
# Where should we put all the mirrored files?
LOG=${LOG:-"${LOGDIR}/${NAME}.log"}
# Where should we put all the mirrored files?
-TO=${TO:-"/
org/ftp.debian.org/ftp
/"}
+TO=${TO:-"/
srv/mirrors/debian
/"}
# used by log() and error()
PROGRAM=${PROGRAM:-"${NAME}-$(hostname -s)"}
# used by log() and error()
PROGRAM=${PROGRAM:-"${NAME}-$(hostname -s)"}
@@
-287,7
+287,7
@@
RSYNC_OPTIONS1=${RSYNC_OPTIONS1:-"--exclude Packages* --exclude Sources* --exclu
# Options for the second pass, where we do want everything, including deletion of old and now unused files
RSYNC_OPTIONS2=${RSYNC_OPTIONS2:-"--max-delete=40000 --delay-updates --delete --delete-after --delete-excluded"}
# Which rsync share to use on our upstream mirror?
# Options for the second pass, where we do want everything, including deletion of old and now unused files
RSYNC_OPTIONS2=${RSYNC_OPTIONS2:-"--max-delete=40000 --delay-updates --delete --delete-after --delete-excluded"}
# Which rsync share to use on our upstream mirror?
-RSYNC_PATH=${RSYNC_PATH:-"
ftp
"}
+RSYNC_PATH=${RSYNC_PATH:-"
debian
"}
# Now add the bwlimit option. As default is 0 we always add it, rsync interprets
# 0 as unlimited, so this is safe.
# Now add the bwlimit option. As default is 0 we always add it, rsync interprets
# 0 as unlimited, so this is safe.
@@
-337,7
+337,7
@@
for ARCH in ${ARCH_EXCLUDE}; do
EXCLUDE="${EXCLUDE} --exclude binary-${ARCH}/ --exclude installer-${ARCH}/ --exclude Contents-${ARCH}.gz --exclude Contents-${ARCH}.bz2 --exclude Contents-${ARCH}.diff/ --exclude arch-${ARCH}.files --exclude arch-${ARCH}.list.gz --exclude *_${ARCH}.deb --exclude *_${ARCH}.udeb --exclude *_${ARCH}.changes"
if [ "${ARCH}" = "source" ]; then
if [ -z ${SOURCE_EXCLUDE} ]; then
EXCLUDE="${EXCLUDE} --exclude binary-${ARCH}/ --exclude installer-${ARCH}/ --exclude Contents-${ARCH}.gz --exclude Contents-${ARCH}.bz2 --exclude Contents-${ARCH}.diff/ --exclude arch-${ARCH}.files --exclude arch-${ARCH}.list.gz --exclude *_${ARCH}.deb --exclude *_${ARCH}.udeb --exclude *_${ARCH}.changes"
if [ "${ARCH}" = "source" ]; then
if [ -z ${SOURCE_EXCLUDE} ]; then
- SOURCE_EXCLUDE=" --exclude source/ --exclude *.tar.gz --exclude *.diff.gz --exclude *.tar.bz2 --exclude *.diff.bz2 --exclude *.dsc "
+ SOURCE_EXCLUDE=" --exclude source/ --exclude *.tar.gz --exclude *.diff.gz --exclude *.tar.bz2 --exclude *.
tar.xz -exclude *.
diff.bz2 --exclude *.dsc "
fi
fi
done
fi
fi
done
@@
-414,6
+414,7
@@
exec >"$LOG" 2>&1 <&-
log "Mirrorsync start"
# Look who pushed us and note that in the log.
log "Mirrorsync start"
# Look who pushed us and note that in the log.
+SSH_CONNECTION=${SSH_CONNECTION:-""}
PUSHFROM="${SSH_CONNECTION%%\ *}"
if [ -n "${PUSHFROM}" ]; then
log "We got pushed from ${PUSHFROM}"
PUSHFROM="${SSH_CONNECTION%%\ *}"
if [ -n "${PUSHFROM}" ]; then
log "We got pushed from ${PUSHFROM}"