From 2e5c40e63214a9df08cdd5c19b2606bffd54b9dc Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Wed, 6 Jan 2016 21:54:19 +0100 Subject: Also create a list of tracefiles --- bin/ftpsync | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/ftpsync b/bin/ftpsync index 8eb7bd5..2527bb3 100755 --- a/bin/ftpsync +++ b/bin/ftpsync @@ -179,7 +179,8 @@ tracefile() { ;; date|terse|full) log "Creating a ${EXTENDEDTRACE} trace file" - if [[ -d $(dirname "${TRACEFILE}") ]]; then + tracedir=$(dirname "${TRACEFILE}") + if [[ -d ${tracedir} ]]; then { LC_ALL=POSIX LANG=POSIX date -u if [[ date != ${EXTENDEDTRACE} ]]; then @@ -230,6 +231,8 @@ tracefile() { } > "${TO}/${TRACEHIERARCHY}".new mv "${TO}/${TRACEHIERARCHY}".new "${TO}/${TRACEHIERARCHY}" cp "${TO}/${TRACEHIERARCHY}" "${TO}/${TRACEHIERARCHY}.mirror" + + (cd ${tracedir} && ls ) | grep -v '^_' > "${TO}/${TRACELIST}" fi ;; *) @@ -351,6 +354,7 @@ UPDATEREQUIRED="${TO}/Archive-Update-Required-${MIRRORNAME}" # Trace file for mirror stats and checks (make sure we get full hostname) TRACE=${TRACE:-"project/trace/${MIRRORNAME}"} TRACEHIERARCHY=${TRACEHIERARCHY:-"project/trace/_hierachy"} +TRACELIST=${TRACEHIERARCHY:-"project/trace/_traces"} # The trace file can have different format/contents. Here you can select # what it will be. # Possible values are @@ -370,7 +374,7 @@ TRACEHOST=${TRACEHOST:-$(hostname -f)} 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_${TRACE}-stage1 --exclude=${TRACEHIERARCHY} --filter=protect_${TRACEHIERARCHY} --filter=protect_Archive-Update-Required-${MIRRORNAME}"} +RSYNC_FILTER=${RSYNC_FILTER:-"--filter=protect_Archive-Update-in-Progress-${MIRRORNAME} --filter=protect_${TRACE} --filter=protect_${TRACE}-stage1 --exclude=${TRACEHIERARCHY} --filter=protect_${TRACEHIERARCHY} --exclude=${TRACELIST} --filter=protect_${TRACELIST} --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} RSYNC_PROTOCOL=$(rsync_protocol) -- cgit v1.2.3