diff options
author | Joerg Jaspert <joerg@debian.org> | 2010-01-02 21:53:20 +0100 |
---|---|---|
committer | Joerg Jaspert <joerg@debian.org> | 2010-01-02 21:53:20 +0100 |
commit | ea27d5078e60133428a445fb582d08ee8150e997 (patch) | |
tree | 2da6fac032d439151785e4339d1e8eb53b27eee2 /bin/ftpsync | |
parent | 7a3b52d9a568dc7a79b44155b701ab47e2f54ff1 (diff) |
ftpsync
Add some statistical foo, idea from Md
Signed-off-by: Joerg Jaspert <joerg@debian.org>
Diffstat (limited to 'bin/ftpsync')
-rwxr-xr-x | bin/ftpsync | 15 |
1 files changed, 15 insertions, 0 deletions
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 |