From ea27d5078e60133428a445fb582d08ee8150e997 Mon Sep 17 00:00:00 2001 From: Joerg Jaspert Date: Sat, 2 Jan 2010 21:53:20 +0100 Subject: ftpsync Add some statistical foo, idea from Md Signed-off-by: Joerg Jaspert --- bin/ftpsync | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/bin/ftpsync b/bin/ftpsync index 103c4f2..f70d506 100755 --- a/bin/ftpsync +++ b/bin/ftpsync @@ -106,6 +106,21 @@ cleanup() { trap - ERR TERM HUP INT QUIT EXIT # all done. Mail the log, exit. log "Mirrorsync done"; + + # Lets get a statistical value + SPEED=$( + SPEEDLINE=$(egrep '[0-9.]+ bytes/sec' ${LOGDIR}/rsync-${NAME}.log) + set "nothing" ${SPEEDLINE} + echo $8 + ) + if [ -n "${SPEED}" ]; then + SPEED=${SPEED%%.*} + SPEED=$(( $SPEED / 1024 )) + else + SPEED='unknown' + fi + log "Rsync transfer speed: ${SPEED} KB/s" + if [ -n "${MAILTO}" ]; then # In case rsync had something on stderr if [ -s "${LOGDIR}/rsync-${NAME}.error" ]; then -- cgit v1.2.3