From ddf4f882086081b70767d410f96adb4c6cc5ad3c Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Wed, 15 Mar 2023 10:52:18 +0100 Subject: [PATCH] Changed Borgmatic dobackups because of Systemd timer use on remotes. --- Plan Borg/models/cron | 2 +- Plan Borg/models/dobackups | 67 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100755 Plan Borg/models/dobackups diff --git a/Plan Borg/models/cron b/Plan Borg/models/cron index a32a6ee..c8f87ce 100644 --- a/Plan Borg/models/cron +++ b/Plan Borg/models/cron @@ -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 diff --git a/Plan Borg/models/dobackups b/Plan Borg/models/dobackups new file mode 100755 index 0000000..353cc58 --- /dev/null +++ b/Plan Borg/models/dobackups @@ -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 "================================================================================"