From 5c256564609b0c959a95c4cc6d9a2dc972411b70 Mon Sep 17 00:00:00 2001 From: szaimen Date: Mon, 24 Oct 2022 19:46:09 +0200 Subject: [PATCH 1/2] install borg from backports in the future Signed-off-by: szaimen --- Containers/borgbackup/Dockerfile | 2 +- Containers/borgbackup/backupscript.sh | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Containers/borgbackup/Dockerfile b/Containers/borgbackup/Dockerfile index 7922e28b..c1e2662c 100644 --- a/Containers/borgbackup/Dockerfile +++ b/Containers/borgbackup/Dockerfile @@ -3,8 +3,8 @@ FROM debian:bullseye-20221004-slim RUN set -ex; \ \ apt-get update; \ + apt-get install -y --no-install-recommends borgbackup -t bullseye-backports; \ apt-get install -y --no-install-recommends \ - borgbackup \ rsync \ fuse \ python3-llfuse \ diff --git a/Containers/borgbackup/backupscript.sh b/Containers/borgbackup/backupscript.sh index d2f61999..254c1fdc 100644 --- a/Containers/borgbackup/backupscript.sh +++ b/Containers/borgbackup/backupscript.sh @@ -155,6 +155,13 @@ if [ "$BORG_MODE" = backup ]; then exit 1 fi + # Compact archives + echo "Compacting the archives..." + if ! borg compact "$BORG_BACKUP_DIRECTORY"; then + echo "Failed to compact archives!" + exit 1 + fi + # Back up additional directories of the host if [ "$ADDITIONAL_DIRECTORIES_BACKUP" = 'yes' ]; then if [ -d "/docker_volumes/" ]; then @@ -172,11 +179,14 @@ if [ "$BORG_MODE" = backup ]; then echo "Backup of additional docker-volumes failed!" exit 1 fi - if ! borg prune --prefix '*_*-additional-docker-volumes' "${BORG_PRUNE_OPTS[@]}"; then echo "Failed to prune additional docker-volumes archives!" exit 1 fi + if ! borg compact "$BORG_BACKUP_DIRECTORY"; then + echo "Failed to compact archives!" + exit 1 + fi fi if [ -d "/host_mounts/" ]; then EXCLUDED_DIRECTORIES=(home/*/.cache root/.cache var/cache lost+found run var/run dev tmp sys proc) @@ -200,6 +210,10 @@ if [ "$BORG_MODE" = backup ]; then echo "Failed to prune additional host-mount archives!" exit 1 fi + if ! borg compact "$BORG_BACKUP_DIRECTORY"; then + echo "Failed to compact archives!" + exit 1 + fi fi fi From f5102f856275cb0f78a1e2a16da0ab85ee27a6df Mon Sep 17 00:00:00 2001 From: szaimen Date: Mon, 24 Oct 2022 20:41:56 +0200 Subject: [PATCH 2/2] add bullseye-backports to sources.list Signed-off-by: szaimen --- Containers/borgbackup/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Containers/borgbackup/Dockerfile b/Containers/borgbackup/Dockerfile index c1e2662c..de0c26bd 100644 --- a/Containers/borgbackup/Dockerfile +++ b/Containers/borgbackup/Dockerfile @@ -2,6 +2,7 @@ FROM debian:bullseye-20221004-slim RUN set -ex; \ \ + echo "deb http://deb.debian.org/debian bullseye-backports main" >> /etc/apt/sources.list; \ apt-get update; \ apt-get install -y --no-install-recommends borgbackup -t bullseye-backports; \ apt-get install -y --no-install-recommends \