From 27c1e0e88d625bdaddc66a04ba3a411c852d4815 Mon Sep 17 00:00:00 2001 From: Simon L Date: Thu, 1 Sep 2022 21:39:20 +0200 Subject: run borg compact regularly (#2390) Signed-off-by: szaimen Signed-off-by: szaimen --- not-supported/borgbackup.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/not-supported/borgbackup.sh b/not-supported/borgbackup.sh index 2330a031..5f8804d5 100644 --- a/not-supported/borgbackup.sh +++ b/not-supported/borgbackup.sh @@ -541,6 +541,17 @@ Please don't restart or shutdown your server until then!" fi done + # Run a borg compact which is required with borg 1.2.0 and higher + if borg compact -h &>/dev/null + then + inform_user "$ICyan" "Starting borg compact which will clean up not needed commits and free space..." + if ! borg compact "$BACKUP_TARGET_DIRECTORY" + then + re_rename_snapshot + send_error_mail "Some errors were reported during borg compact!" + fi + fi + # Rename the snapshot back to normal if ! re_rename_snapshot then -- cgit v1.2.3