Plan borg: updates (step).

This commit is contained in:
Christian P. MOMON 2023-01-23 02:29:24 +01:00
parent 6e006c02f1
commit 96880da3dc
2 changed files with 54 additions and 28 deletions

View File

@ -68,6 +68,7 @@ Installer les paquets nécessaires :
```
apt update
apt install -t bullseye-backports borgmatic borgbackup
apt gawk bc
```
Créer un utilisateur dédié `borg` :
@ -310,32 +311,33 @@ Pour Borgmatic :
Résultat de `doreport` :
```
COMPUTER COUNT LAST Original size Compressed size Deduplicated size Duration
audio.a-lec.org 4 2023-01-22T00:11 24.80 GB 6.87 GB 1.70 GB 18.07 s
audio.chalec.org 8 2023-01-22T00:18 54.81 GB 15.39 GB 2.11 GB 25.38 s
ctrlv.chalec.org 4 2023-01-22T00:19 27.47 GB 8.26 GB 2.10 GB 24.22 s
dns.libre-en-communs.org 4 2023-01-22T00:10 16.12 GB 7.18 GB 1.80 GB 26.57 s
forge.chalec.org 3 2023-01-22T00:19 32.76 GB 16.33 GB 4.70 GB 1 min 10.38 s
gestion.a-lec.org 3 2023-01-22T00:11 43.42 GB 18.56 GB 5.74 GB 2 min 35.41 s
git.a-lec.org 3 2023-01-22T00:14 44.72 GB 22.87 GB 7.52 GB 1 min 14.41 s
isengard.libre-en-communs.org 3 2023-01-22T00:10 37.04 GB 15.26 GB 5.16 GB 35.08 s
libreverse.chalec.org 4 2023-01-22T00:20 40.64 GB 15.92 GB 4.68 GB 41.89 s
mail.a-lec.org 3 2023-01-22T00:16 32.69 GB 14.87 GB 4.29 GB 1 min 3.38 s
pad.chalec.org 4 2023-01-22T00:21 32.79 GB 12.19 GB 2.89 GB 43.64 s
petition.chalec.org 4 2023-01-22T00:22 25.17 GB 7.67 GB 1.86 GB 34.06 s
sauvkipeu.libre-en-communs.org 10 2023-01-22T00:59 13.10 GB 6.14 GB 650.40 MB 10.79 s
stats.chalec.org 8 2023-01-22T00:23 51.54 GB 14.63 GB 1.93 GB 21.06 s
status.chalec.org 11 2023-01-22T00:23 23.22 GB 9.91 GB 1.19 GB 15.34 s
visio.chalec.org 4 2023-01-22T00:23 28.73 GB 8.90 GB 2.21 GB 20.53 s
www.a-lec.org 3 2023-01-22T00:17 16.75 GB 7.41 GB 2.19 GB 25.36 s
www.chalec.org 4 2023-01-22T00:24 27.31 GB 9.71 GB 2.29 GB 21.57 s
xmpp.a-lec.org 4 2023-01-22T00:17 49.53 GB 27.44 GB 6.90 GB 41.97 s
xmpp.chalec.org 4 2023-01-22T00:24 46.55 GB 18.40 GB 4.71 GB 52.14 s
Total repository count: 20
Total archive count: 95
Total disk size: 68G .
COMPUTER COUNT LAST Diff Original Compressed Dedup Duration
audio.a-lec.org 6 2023-01-23T00:11 11.05 MB 37.21 GB 10.31 GB 1.72 GB 00:00:20
audio.chalec.org 10 2023-01-23T00:18 24.09 MB 68.38 GB 19.18 GB 2.16 GB 00:00:24
aunt.libre-en-communs.org 1 2023-01-22T02:43 2.23 GB 23.48 GB 2.35 GB 2.23 GB 00:03:31
ctrlv.chalec.org 6 2023-01-23T00:19 3.42 MB 41.24 GB 12.39 GB 2.10 GB 00:00:22
dns.libre-en-communs.org 6 2023-01-23T00:10 22.79 MB 24.18 GB 10.78 GB 1.83 GB 00:00:26
forge.chalec.org 5 2023-01-23T00:19 696.08 MB 54.85 GB 27.66 GB 5.41 GB 00:01:46
gestion.a-lec.org 5 2023-01-23T00:11 23.53 MB 72.35 GB 30.94 GB 5.78 GB 00:02:26
git.a-lec.org 5 2023-01-23T00:14 130.11 MB 74.12 GB 38.07 GB 7.68 GB 00:01:18
isengard.libre-en-communs.org 5 2023-01-23T00:10 130.18 MB 61.74 GB 25.47 GB 5.37 GB 00:00:39
libreverse.chalec.org 6 2023-01-23T00:21 680.08 MB 60.97 GB 23.88 GB 5.55 GB 00:00:47
mail.a-lec.org 5 2023-01-23T00:15 67.06 MB 54.40 GB 24.77 GB 4.41 GB 00:01:11
pad.chalec.org 6 2023-01-23T00:22 77.97 MB 49.18 GB 18.28 GB 2.98 GB 00:00:44
petition.chalec.org 6 2023-01-23T00:23 6.50 MB 37.76 GB 11.50 GB 1.87 GB 00:00:33
sauvkipeu.libre-en-communs.org 12 2023-01-23T00:10 6.04 MB 15.73 GB 7.37 GB 661.52 MB 00:00:12
stats.chalec.org 10 2023-01-23T00:24 26.15 MB 64.43 GB 18.29 GB 1.98 GB 00:00:22
status.chalec.org 11 2023-01-23T00:24 13.34 MB 23.24 GB 9.91 GB 1.20 GB 00:00:18
visio.chalec.org 6 2023-01-23T00:24 12.38 MB 43.08 GB 13.35 GB 2.23 GB 00:00:21
www.a-lec.org 5 2023-01-23T00:17 24.66 MB 27.91 GB 12.35 GB 2.24 GB 00:00:25
www.chalec.org 6 2023-01-23T00:25 16.68 MB 40.95 GB 14.57 GB 2.32 GB 00:00:24
xmpp.a-lec.org 6 2023-01-23T00:17 48.87 MB 74.14 GB 41.13 GB 6.97 GB 00:00:45
xmpp.chalec.org 6 2023-01-23T00:25 556.20 MB 69.83 GB 27.70 GB 5.31 GB 00:01:08
Total repository count: 21
Total archive count: 134
Total disk size: 73G .
Sys. de fichiers Taille Utilisé Dispo Uti% Monté sur
/dev/sda1 229G 70G 147G 33% /
/dev/sda1 229G 75G 142G 35% /
```
## Récupération

View File

@ -2,6 +2,32 @@
SCRIPT_NAME="$(basename "$0")"
roundn()
{
echo $(echo "($1+0.5)/1" | bc)
}
convert_duration()
{
local input="$1"
local minutes
if [[ $input =~ ([0-9]+)\ minutes ]]; then
minutes=${BASH_REMATCH[1]}
else
minutes=0
fi
local seconds
if [[ $input =~ ([0-9\.]+)\ seconds ]]; then
seconds=${BASH_REMATCH[1]}
seconds=$(roundn $seconds)
else
seconds=0
fi
printf "00:%02d:%02d\n" ${minutes} ${seconds}
}
#
export BORG_PASSCOMMAND="cat /srv/borg/.borg-passphrase"
BORG_REPOS="/var/backups/borg/"
@ -25,9 +51,7 @@ for BORG_REPO in $(ls -d *.repo); do
SIZES="${SIZE_LINE:13}"
INFOS=$(borg info "${BORG_REPO}::${LAST}")
DURATION=$(echo "$INFOS" | grep Duration)
DURATION=${DURATION:10}
DURATION=${DURATION/ minutes / min }
DURATION=${DURATION/ seconds/ s}
DURATION=$(convert_duration "${DURATION:10}")
DIFF_SIZE=$(echo "$INFOS" | grep "This archive" | awk '{ print $7" "$8}')
printf "%-40s %2d %s %12s %12s %12s %12s %s\n" "$COMPUTER" "$COUNT" "$LAST" "$DIFF_SIZE" "$ORIGINAL_SIZE" "$COMPRESSED_SIZE" "$DEDUP_SIZE" "$DURATION"