print human-readable size of debian

This commit is contained in:
z4yx 2020-03-21 12:08:10 +08:00
parent 1dc46a67a7
commit 90e34a3a2e

View File

@ -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}.log" &
tail --retry -f "${FTPSYNC_LOG_DIR}/rsync-ftpsync-${jobname}.error" & tail --retry -f "${FTPSYNC_LOG_DIR}/rsync-ftpsync-${jobname}.error" &
wait $PID 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 else
echo "Invalid command line" echo "Invalid command line"
exit 1 exit 1