summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2016-01-08 16:29:27 +0100
committerPeter Palfrader <peter@palfrader.org>2016-01-08 16:30:00 +0100
commit08fba9969db77a0563960e1c053a424d02d8ca5b (patch)
treeec27fa9b004317a8310e4b579323193ee9d0919b
parent3adcb19f8d9ddee67c2e2404de198fdeb39e2581 (diff)
No need to grep and awk. Just awk
-rwxr-xr-xbin/ftpsync2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/ftpsync b/bin/ftpsync
index 8ecaf37..8f77988 100755
--- a/bin/ftpsync
+++ b/bin/ftpsync
@@ -213,7 +213,7 @@ tracefile() {
echo "Upstream-mirror: ${RSYNC_HOST}"
total=0
if [[ -e ${LOGDIR}/rsync-${NAME}.log ]]; then
- for bytes in $(egrep 'Total bytes received: ' "${LOGDIR}/rsync-${NAME}.log" | awk -F: '{print $2}'); do
+ for bytes in $(awk -F': ' '$1 == "Total bytes received" {print $2} ' "${LOGDIR}/rsync-${NAME}.log"); do
bytes=${bytes//,}
total=$(( total + bytes ))
done