From f5aba53bbbb602693a2ece17cb271be507c3c5fd Mon Sep 17 00:00:00 2001 From: Joerg Jaspert Date: Wed, 30 Dec 2009 21:24:18 +0100 Subject: ftpsync tracefile only update the tracefile if it is a stage2 or all sync Signed-off-by: Joerg Jaspert --- bin/ftpsync | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'bin/ftpsync') diff --git a/bin/ftpsync b/bin/ftpsync index d016f89..ce77a21 100755 --- a/bin/ftpsync +++ b/bin/ftpsync @@ -448,10 +448,14 @@ function mainroutine() { hook $HOOK done - if [ -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}" + # 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 + LC_ALL=POSIX LANG=POSIX date -u > "${TO}/${TRACE}" + echo "Used ftpsync version: ${VERSION}" >> "${TO}/${TRACE}" + echo "Running on host: $(hostname -f)" >> "${TO}/${TRACE}" + fi fi HOOK=( -- cgit v1.2.3