diff options
author | Peter Palfrader <peter@palfrader.org> | 2016-01-06 21:54:19 +0100 |
---|---|---|
committer | Peter Palfrader <peter@palfrader.org> | 2016-01-06 21:54:19 +0100 |
commit | 2e5c40e63214a9df08cdd5c19b2606bffd54b9dc (patch) | |
tree | 6ed50c3289285647e26b979eca80d5c559e50c4a | |
parent | 743b61189278e9ef00efa62b1a5aa1bbde483813 (diff) |
Also create a list of tracefiles
-rwxr-xr-x | bin/ftpsync | 8 |
1 files 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) |