Changed Borgmatic dobackups because of Systemd timer use on remotes.

This commit is contained in:
Christian P. MOMON 2023-03-15 10:52:18 +01:00
parent 9722e8e4e6
commit ddf4f88208
2 changed files with 68 additions and 1 deletions

View File

@ -1,3 +1,3 @@
10 5 * * * root /srv/borg/bin/dobackups >> /var/backups/borg/dobackups.log 2>&1
2 0 * * * root /srv/borg/bin/dobackups >> /var/backups/borg/dobackups.log 2>&1
10 7 * * * root /srv/borg/bin/dochecks >> /var/backups/borg/dochecks.log 2>&1
10 12 * * * root /srv/borg/bin/doprunes >> /var/backups/borg/doprunes.log 2>&1

67
Plan Borg/models/dobackups Executable file
View File

@ -0,0 +1,67 @@
#!/bin/bash
BINDIR=$(dirname "$0")
cd "$BINDIR"
echo "================================================================================"
echo " Sauvegardes du "$(date)
echo "================================================================================"
START_TIME=$(date +"%s")
START_SIZE=$(du -s /var/backups/borg/ | awk '{ print $1 }')
## Local machine.
./dobackup-local
## Libre en Communs machines.
# anthea.libre-en-communs.org
#systemd ./dobackup-remote aunt.libre-en-communs.org
# britt.libre-en-communs.org
# fontainebleau
# leparc
#systemd ./dobackup-remote mother.libre-en-communs.org
#systemd ./dobackup-remote dns.libre-en-communs.org
#systemd ./dobackup-remote isengard.libre-en-communs.org
## A-lec
#systemd ./dobackup-remote audio.a-lec.org
#systemd ./dobackup-remote gestion.a-lec.org
#systemd ./dobackup-remote git.a-lec.org
#systemd ./dobackup-remote mail.a-lec.org
#-toot.a-lec.org
#systemd ./dobackup-remote www.a-lec.org
#systemd ./dobackup-remote xmpp.a-lec.org
# Chalec
#systemd ./dobackup-remote audio.chalec.org
#systemd ./dobackup-remote ctrlv.chalec.org
#systemd ./dobackup-remote forge.chalec.org
#systemd ./dobackup-remote libreverse.chalec.org
#-nuage.chalec.org
#systemd ./dobackup-remote pad.chalec.org
#systemd ./dobackup-remote petition.chalec.org
#systemd ./dobackup-remote stats.chalec.org
#systemd ./dobackup-remote status.chalec.org
#-toot.chalec.org
#-video.chalec.org
#systemd ./dobackup-remote visio.chalec.org
#systemd ./dobackup-remote www.chalec.org
#systemd ./dobackup-remote xmpp.chalec.org
DURATION=$(($(date +"%s")-$START_TIME))
DURATION=$(printf "%02d:%02d:%02d" $((DURATION/60/60)) $((DURATION/60%60)) $((DURATION%60)))
echo "Midded at: "$(date)" Duration: $DURATION"
# Wait the end of remote Systemd timer backup (5 hours).
sleep 18000
./doreport
echo "====="
DURATION=$(($(date +"%s")-$START_TIME))
DURATION=$(printf "%02d:%02d:%02d" $((DURATION/60/60)) $((DURATION/60%60)) $((DURATION%60)))
END_SIZE=$(du -s /var/backups/borg/ | awk '{ print $1 }')
DIFF_SIZE=$(((END_SIZE-START_SIZE)/1024))
echo "Ended at: "$(date)" Duration: $DURATION Size: $DIFF_SIZE MB"
echo "================================================================================"