Add compact auto run in intervals like check archive

Same settings like check archive in days. Auto set to 1 to run after
each prune. Can be controlled per module.
This commit is contained in:
Clemens Schwaighofer
2022-06-06 14:58:36 +09:00
parent 9739436589
commit abbcfa883f
10 changed files with 149 additions and 39 deletions

View File

@@ -3,15 +3,16 @@
# Backup gitea database, all git folders and gitea settings
MODULE="gitea"
MODULE_VERSION="1.1.3";
MODULE_VERSION="1.1.4";
DIR="${BASH_SOURCE%/*}"
if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi
# init system
. "${DIR}/borg.backup.functions.init.sh";
# init verify and check file
# init verify, compact and check file
BACKUP_INIT_FILE="borg.backup.${MODULE}.init";
BACKUP_COMPACT_FILE="borg.backup.${MODULE}.compact";
BACKUP_CHECK_FILE="borg.backup.${MODULE}.check";
# lock file
BACKUP_LOCK_FILE="borg.backup.${MODULE}.lock";
@@ -83,7 +84,7 @@ if [ -z "${ONE_TIME_TAG}" ]; then
echo "Prune repository with keep${KEEP_INFO:1}";
${BORG_PRUNE};
# if this is borg version >1.2 we need to run compact after prune
. "${DIR}/borg.backup.functions.compact.sh";
. "${DIR}/borg.backup.functions.compact.sh" "auto";
# check in auto mode
. "${DIR}/borg.backup.functions.check.sh" "auto";
fi;