Merge pull request #1305 from nextcloud/enh/279/update-borg

install borg from backports in the future
This commit is contained in:
Simon L 2022-10-24 20:45:39 +02:00 committed by GitHub
commit 69122c55bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 2 deletions

View file

@ -2,9 +2,10 @@ 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 \
borgbackup \
rsync \
fuse \
python3-llfuse \

View file

@ -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