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

View File

@ -4,22 +4,28 @@ 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"
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}"
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
done
echo "Total count:"$TOTAL_COUNT
echo "Total size: "$(du -sh .)
echo "Total repository count: "$REPO_COUNT
echo "Total archive count: "$ARCHIVE_COUNT
echo "Total disk size: "$(du -sh .)
df -h /var/backups/borg/.