diff options
author | Joerg Jaspert <joerg@debian.org> | 2009-12-30 21:24:18 +0100 |
---|---|---|
committer | Joerg Jaspert <joerg@debian.org> | 2009-12-30 21:24:18 +0100 |
commit | f5aba53bbbb602693a2ece17cb271be507c3c5fd (patch) | |
tree | 482255519a1278e6520fd8a2929b1073404928e6 | |
parent | 3ee494ec413f26d99e28b227c3a28c72cc664d24 (diff) |
ftpsync tracefile
only update the tracefile if it is a stage2 or all sync
Signed-off-by: Joerg Jaspert <joerg@debian.org>
-rwxr-xr-x | bin/ftpsync | 12 |
1 files changed, 8 insertions, 4 deletions
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=( |