#!/bin/bash SCRIPT_NAME="$(basename "$0")" BORG_REPOS="/var/backups/borg/" cd $BORG_REPOS ARCHIVE_COUNT=0 REPO_COUNT=0 echo "COMPUTER COUNT LAST Original size Compressed size Deduplicated size Duration" for BORG_REPO in $(ls -d *.repo); do if [ -d "$BORG_REPO" ]; then #echo "== $BORG_REPO" REPO_COUNT=$(( REPO_COUNT +1)) COMPUTER=$(printf "%-40s" ${BORG_REPO::-5}) LIST=$(borg list "$BORG_REPO") COUNT=$(echo "$LIST" | wc -l) LAST=$(echo "$LIST" | sort -h | tail -1 | awk '{ print $1}' ) SIZE_LINE=$(borg info "$BORG_REPO" | head -8 | tail -1) SIZES="${SIZE_LINE:13}" DURATION=$(borg info "${BORG_REPO}::${LAST}" | grep Duration) DURATION=${DURATION:10} printf "%-40s %2d %s %s %s\n" "$COMPUTER" "$COUNT" "$LAST" "$SIZES" "$DURATION" ARCHIVE_COUNT=$((ARCHIVE_COUNT+COUNT)) fi done echo "Total repository count: "$REPO_COUNT echo "Total archive count: "$ARCHIVE_COUNT echo "Total disk size: "$(du -sh .) df -h /var/backups/borg/.