From 9d7921a36eabd23d2fd9e842fae01bfe01e8a69c Mon Sep 17 00:00:00 2001 From: Raphael Geissert Date: Thu, 26 Apr 2012 22:28:56 -0500 Subject: Only update the trace file if no AUIP file is found It is otherwise possible for a mirror to be synced while the upstream is not yet done syncing and for the site trace to be updated regardless. --- bin/ftpsync | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/bin/ftpsync b/bin/ftpsync index 1ae7b81..9cfe35e 100755 --- a/bin/ftpsync +++ b/bin/ftpsync @@ -523,7 +523,21 @@ done # We only update our tracefile when we had a stage2 or an all sync. # Otherwise we would update it after stage1 already, which is wrong. if [ "xtruex" = "x${SYNCSTAGE2}x" ] || [ "xtruex" = "x${SYNCALL}x" ]; then - if [ -d "$(dirname "${TO}/${TRACE}")" ]; then + should_update=true + for aupfile in "${TO}/Archive-Update-in-Progress-"*; do + case "$aupfile" in + "${TO}/Archive-Update-in-Progress-*") + : + ;; + "${LOCK}") + : + ;; + *) + should_update=false + ;; + esac + done + if $should_update && [ -d "$(dirname "${TO}/${TRACE}")" ]; then LC_ALL=POSIX LANG=POSIX date -u > "${TO}/${TRACE}" echo "Used ftpsync version: ${VERSION}" >> "${TO}/${TRACE}" echo "Running on host: $(hostname -f)" >> "${TO}/${TRACE}" -- cgit v1.2.3