Plan borg: updates (step).

This commit is contained in:
Christian P. MOMON 2023-01-21 16:25:50 +01:00
parent 0528db2914
commit 6d855fba97
2 changed files with 48 additions and 37 deletions

View File

@ -2,49 +2,54 @@
BINDIR=$(dirname "$0") BINDIR=$(dirname "$0")
echo $BINDIR cd "$BINDIR"
echo "================================================================================" echo "================================================================================"
echo " Sauvegardes du "$(date) echo " Sauvegardes du "$(date)
echo "================================================================================" echo "================================================================================"
START_TIME=$(date +"%s") START_TIME=$(date +"%s")
# Local machine. ## Local machine.
#${BINDIR}/dobackup-local #./dobackup-local
# Main machines. ## Routers.
# aunt
# mother
# Routers.
# leparc # leparc
# fontainebleau # fontainebleau
# gisors # gisors
# Virtual machines. ## Libre en Communs machines.
# audio # aunt.libre-en-communs.org
#${BINDIR}/dobackup-remote audio.chalec.org # mother.libre-en-communs.org
# ctrlv.chalec.org #./dobackup-remote dns.libre-en-communs.org
# dns
# forge.chalec.org
# gestion.a-lec.org
# git
# isengard.libre-en-communs.org # isengard.libre-en-communs.org
# libreverse.chalec.org
# mail ## A-lec
# nuage.chalec.org #./dobackup-remote audio.a-lec.org
# pad.chalec.org #./dobackup-remote gestion.a-lec.org
# petition.chalec.org #./dobackup-remote git.a-lec.org
#${BINDIR}/dobackup-remote stats.chalec.org #./dobackup-remote mail.a-lec.org
#${BINDIR}/dobackup-remote status.chalec.org #-toot.a-lec.org
# toot #./dobackup-remote www.a-lec.org
# toot.chalec.org #./dobackup-remote xmpp.a-lec.org
# video.chalec.org
# visio.chalec.org
# www # Chalec
# www.chalec.org #./dobackup-remote audio.chalec.org
# xmpp #./dobackup-remote ctrlv.chalec.org
# xmpp.chalec.org #./dobackup-remote forge.chalec.org
#./dobackup-remote libreverse.chalec.org
#-nuage.chalec.org
#./dobackup-remote pad.chalec.org
#./dobackup-remote petition.chalec.org
#./dobackup-remote stats.chalec.org
#./dobackup-remote status.chalec.org
#-toot.chalec.org
#-video.chalec.org
#./dobackup-remote visio.chalec.org
#./dobackup-remote www.chalec.org
#./dobackup-remote xmpp.chalec.org
./doreport
echo "=====" echo "====="
DURATION=$(($(date +"%s")-$START_TIME)) DURATION=$(($(date +"%s")-$START_TIME))

View File

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