Borg backup wrapper update, config update

Add a .gitignore for all other files that can appear in this
folder
(.config, .cache, settings files, etc)
Add backward compability check for file backup to
not auto add -file for
the file module unless flag is set
(FILE_REPOSITORY_COMPATIBLE)
This commit is contained in:
Clemens Schwaighofer
2021-12-13 13:19:31 +09:00
parent 93f8ea6054
commit a661678441
8 changed files with 44 additions and 21 deletions

View File

@@ -47,6 +47,11 @@ PRINT=0;
# flags, set to no to disable
_BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK="yes";
_BORG_RELOCATED_REPO_ACCESS_IS_OK="yes";
# compatible settings
# NOTE: to keep the old .borg repository name for file module set this to true
# if set to false (future) it will add -file to the repository name like for other
# modules
FILE_REPOSITORY_COMPATIBLE="true";
# other variables
TARGET_SERVER="";
REGEX="";
@@ -81,7 +86,6 @@ SUB_COMPRESSION_LEVEL="";
ENCRYPTION="none";
# force check always
FORCE_CHECK="false";
DATE=""; # to be deprecated
BACKUP_SET="";
SUB_BACKUP_SET="";
# for database backup only
@@ -245,8 +249,6 @@ if [ -f "${BASE_FOLDER}${SETTINGS_FILE_SUB}" ]; then
if [ ! -z "${SUB_BACKUP_FILE}" ]; then
BACKUP_FILE=${SUB_BACKUP_FILE}
fi;
# add module name to backup file, always
BACKUP_FILE=${BACKUP_FILE/.borg/-${MODULE,,}.borg};
# if sub backup set it set, override current
if [ ! -z "${SUB_BACKUP_SET}" ]; then
BACKUP_SET=${SUB_BACKUP_SET};
@@ -281,6 +283,11 @@ if [ -f "${BASE_FOLDER}${SETTINGS_FILE_SUB}" ]; then
KEEP_WITHIN=${SUB_KEEP_WITHIN};
fi;
fi;
# add module name to backup file, always
# except if FILE module and FILE_REPOSITORY_COMPATIBLE="true"
if ([ "${FILE_REPOSITORY_COMPATIBLE}" = "false" ] && [ "${MODULE,,}" = "file" ]) || [ "${MODULE,,}" != "file" ]; then
BACKUP_FILE=${BACKUP_FILE/.borg/-${MODULE,,}.borg};
fi;
# backup file must be set
if [ -z "${BACKUP_FILE}" ]; then
echo "No BACKUP_FILE set";