summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphael Geissert <atomo64@gmail.com>2012-04-26 22:28:56 -0500
committerRaphael Geissert <atomo64@gmail.com>2012-04-26 22:28:56 -0500
commit9d7921a36eabd23d2fd9e842fae01bfe01e8a69c (patch)
treea4252cd7b4bb6ce88960d203e9b565edd31edb6e
parentab952faad4e228b4098b973cba8b82c07f5d9b5c (diff)
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.
-rwxr-xr-xbin/ftpsync16
1 files changed, 15 insertions, 1 deletions
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}"