summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2016-01-06 16:07:26 +0100
committerPeter Palfrader <peter@palfrader.org>2016-01-06 16:07:26 +0100
commit42c4580547a8df2274eaff5d8eaffe0e0907cb86 (patch)
tree0e8ce4eb152a84959f257c0e01aac4a1d23cbd80
parent4654fd62f4e8ed6f8d9783f465f04ae18b68d4e5 (diff)
Do stage1 tracefile at the end, if we only did stage1
-rwxr-xr-xbin/ftpsync16
1 files changed, 9 insertions, 7 deletions
diff --git a/bin/ftpsync b/bin/ftpsync
index 385aa92..78f09de 100755
--- a/bin/ftpsync
+++ b/bin/ftpsync
@@ -205,11 +205,13 @@ tracefile() {
echo "Architectures: ${out}"
echo "Upstream-mirror: ${RSYNC_HOST}"
total=0
- for bytes in $(egrep 'Total bytes received: ' "${LOGDIR}/rsync-${NAME}.log" | awk -F: '{print $2}'); do
- bytes=${bytes//,}
- total=$((total + bytes))
- done
- echo "Total bytes received in rsync: ${total}"
+ if [[ -e "${LOGDIR}/rsync-${NAME}.log" ]]; then
+ for bytes in $(egrep 'Total bytes received: ' "${LOGDIR}/rsync-${NAME}.log" | awk -F: '{print $2}'); do
+ bytes=${bytes//,}
+ total=$((total + bytes))
+ done
+ echo "Total bytes received in rsync: ${total}"
+ fi
echo "Total time spent in rsync: ${STATS_TOTAL_RSYNC_TIME}"
if [[ 0 != ${STATS_TOTAL_RSYNC_TIME} ]]; then
rate=$(( total / STATS_TOTAL_RSYNC_TIME ))
@@ -594,8 +596,6 @@ while [[ -e ${UPDATEREQUIRED} ]]; do
exit 3
fi
- tracefile "${TO}/${TRACE}-stage1"
-
HOOK=(
HOOKNR=2
HOOKSCR=${HOOK2}
@@ -678,6 +678,8 @@ done
# Otherwise we would update it after stage1 already, which is wrong.
if [[ true = ${SYNCSTAGE2} ]] || [[ true = ${SYNCALL} ]]; then
tracefile
+elif [[ true = ${SYNCSTAGE1} ]]; then
+ tracefile "${TO}/${TRACE}-stage1"
fi