From 08841220ab6e9fdc828e3f2cba7da84abdc0df1b Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Sun, 19 Mar 2023 01:43:43 +0100 Subject: [PATCH] Improved Plan B scripts. --- Plan Borg/bin/doinit-rsync | 8 +++----- Plan Borg/bin/push-mirror | 4 ++-- Plan Borg/models/model-conf-rsync.yaml | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Plan Borg/bin/doinit-rsync b/Plan Borg/bin/doinit-rsync index 9d30cf9..a0adeee 100755 --- a/Plan Borg/bin/doinit-rsync +++ b/Plan Borg/bin/doinit-rsync @@ -23,11 +23,9 @@ if (( $help )); then else COMPUTER="$1" - echo "== Create the mirroring directory." - mkdir -p /var/backups/borg/mirrors/${COMPUTER} - - echo "== Create dedicated cache." - mkdir /var/backups/borg/mirrors/${COMPUTER}.cache + echo "== Create the mirroring directories." + mkdir -p /var/backups/borg/mirrors/${COMPUTER}/{mirror,cache} + chown -R borg.borg /var/backups/borg/mirrors/${COMPUTER} echo "== Create the borgmatic configuration file." cp /srv/borg/models/model-conf-rsync.yaml /etc/borgmatic.d/${COMPUTER}.yaml diff --git a/Plan Borg/bin/push-mirror b/Plan Borg/bin/push-mirror index 51a4b1e..5b20145 100644 --- a/Plan Borg/bin/push-mirror +++ b/Plan Borg/bin/push-mirror @@ -1,6 +1,6 @@ #!/bin/bash PORT=222 BACKUP_SERVER=sauvkipeu.libre-en-communs.org -rsync -aq -e "ssh -p ${PORT} -i /root/.ssh/backup_ssh_key" --numeric-ids --update --delete --delete-after --exclude '/dev/' --exclude '/proc/' --exclude '/sys/' / borg@${BACKUP_SERVER}:/var/backups/borg/mirrors/${HOSTNAME}.libre-en-communs.org/ +rsync -aq -e "ssh -p ${PORT} -i /root/.ssh/backup_ssh_key" --numeric-ids --update --delete --delete-after --exclude '/dev/' --exclude '/proc/' --exclude '/sys/' / borg@${BACKUP_SERVER}:/mirror/ #BACKUP_SERVER=gardefou.libre-en-communs.org -#rsync -aq -e "ssh -p ${PORT} -i /root/.ssh/backup_ssh_key" --numeric-ids --update --delete --delete-after --exclude '/dev/' --exclude '/proc/' --exclude '/sys/' / borg@${BACKUP_SERVER}:/var/backups/borg/mirrors/${HOSTNAME}.libre-en-communs.org/ +#rsync -aq -e "ssh -p ${PORT} -i /root/.ssh/backup_ssh_key" --numeric-ids --update --delete --delete-after --exclude '/dev/' --exclude '/proc/' --exclude '/sys/' / borg@${BACKUP_SERVER}:/mirror/ diff --git a/Plan Borg/models/model-conf-rsync.yaml b/Plan Borg/models/model-conf-rsync.yaml index 22aed67..9f6b71b 100644 --- a/Plan Borg/models/model-conf-rsync.yaml +++ b/Plan Borg/models/model-conf-rsync.yaml @@ -8,7 +8,7 @@ location: storage: encryption_passcommand: 'cat /srv/borg/.borg-passphrase' archive_name_format: '{now:%Y-%m-%dT%H:%M}' - borg_cache_directory: /var/backups/borg/mirrors/.cache + borg_cache_directory: /var/backups/borg/mirrors//cache retention: !include /etc/borgmatic/retention.yaml