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

@@ -7,7 +7,7 @@
# set last edit date + time
MODULE="mysql"
MODULE_VERSION="1.1.1";
MODULE_VERSION="1.1.2";
DIR="${BASH_SOURCE%/*}"
if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi
@@ -18,8 +18,9 @@ if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi
INCLUDE_FILE="borg.backup.${MODULE}.include";
EXCLUDE_FILE="borg.backup.${MODULE}.exclude";
SCHEMA_ONLY_FILE="borg.backup.${MODULE}.schema-only";
# 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";
@@ -217,7 +218,7 @@ fi;
# run compact at the end if not a dry run
if [ -z "${ONE_TIME_TAG}" ]; then
# 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;