Files
BorgBackupWrapper/borg.backup.functions.info.sh
Clemens Schwaighofer 8e87503528 Add auto check functionality
CHECK_INTERVAL or SUB_CHECK_INTERVAL in module settings.
If set to 1, will check everytime.
Ever other number is for n days after last check.

FORCE_CHECK for check if repository has been setup os now renamed
FORCE_VERIFY but FORCE_CHECK is currently still honored but deprecated

all *function* shell scripts will abort if run on their own

Print info on last check time if set in info block

Internal updates:
All separator lines are now printf strings for central control.
All module used config/settings file names use $MODULE name
Check functionality is in its own file
2022-04-25 06:49:57 +09:00

36 lines
970 B
Bash

#!/usr/bin/env bash
if [ -z "${MODULE}" ]; then
echo "Script cannot be run on its own";
exit 1;
fi;
if [ ${INFO} -eq 1 ]; then
printf "${PRINTF_SUB_BLOCK}" "INFO" "$(date +'%F %T')" "${MODULE}";
# show command on debug or dry run
if [ ${DEBUG} -eq 1 ] || [ ${DRYRUN} -eq 1 ]; then
echo "export BORG_BASE_DIR=\"${BASE_FOLDER}\";${BORG_COMMAND} info ${OPT_REMOTE} ${REPOSITORY}";
fi;
# run info command if not a dry drun
if [ ${DRYRUN} -eq 0 ]; then
${BORG_COMMAND} info ${OPT_REMOTE} ${REPOSITORY};
fi;
if [ "${MODULE}" = "files" ]; then
if [ $FOLDER_OK -eq 1 ]; then
echo "--- [Run command]:";
#IFS="#";
echo "export BORG_BASE_DIR=\"${BASE_FOLDER}\";${COMMAND} "${FOLDERS_Q[*]};
else
echo "[!] No folders where set for the backup";
fi;
# remove the temporary exclude file if it exists
if [ -f "${TMP_EXCLUDE_FILE}" ]; then
rm -f "${TMP_EXCLUDE_FILE}";
fi;
fi;
. "${DIR}/borg.backup.functions.close.sh";
exit;
fi;
# __END__