Plan borg: updates (step).
This commit is contained in:
parent
8ae976884d
commit
7344b29d4a
|
@ -0,0 +1,24 @@
|
|||
#!/bin/bash
|
||||
|
||||
SCRIPT_NAME="$(basename "$0")"
|
||||
|
||||
BORG_REPOS="/var/backups/borg/"
|
||||
cd $BORG_REPOS
|
||||
TOTAL_COUNT=0
|
||||
echo "COMPUTER COUNT LAST Original size Compressed size Deduplicated size"
|
||||
for BORG_REPO in $(ls -d *.repo); do
|
||||
if [ -d "$BORG_REPO" ]; then
|
||||
#echo "== $BORG_REPO"
|
||||
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}"
|
||||
printf "%-40s %2d %s %s\n" "$COMPUTER" "$COUNT" "$LAST" "$SIZES"
|
||||
|
||||
TOTAL_COUNT=$((TOTAL_COUNT+COUNT))
|
||||
fi
|
||||
done
|
||||
echo "Total count:"$TOTAL_COUNT
|
||||
echo "Total size: "$(du -sh .)
|
Loading…
Reference in New Issue