From 90e34a3a2e154f640b48ba80fd3b45b6cd4a1cdb Mon Sep 17 00:00:00 2001 From: z4yx Date: Sat, 21 Mar 2020 12:08:10 +0800 Subject: [PATCH] print human-readable size of debian --- debian.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian.sh b/debian.sh index 8ae6b9a..891a292 100755 --- a/debian.sh +++ b/debian.sh @@ -24,6 +24,8 @@ if [[ $1 == sync:archive:* ]]; then tail --retry -f "${FTPSYNC_LOG_DIR}/rsync-ftpsync-${jobname}.log" & tail --retry -f "${FTPSYNC_LOG_DIR}/rsync-ftpsync-${jobname}.error" & wait $PID + sz=$(tail -n 15 ${FTPSYNC_LOG_DIR}/rsync-ftpsync-${jobname}.log|grep -Po '(?<=Total file size: )\d+') + [[ -z "$sz" ]] || echo "Total size is" $(numfmt --to=iec $sz) else echo "Invalid command line" exit 1