Fix zabbix dump var name, remove repository replace

in all BORG_* calls remove the REPOSITORY replace as the repository is
set beforehand for the module

Fix the ZABBIX_DUMP_BIN name in settings and check
This commit is contained in:
Clemens Schwaighofer
2021-12-15 12:50:26 +09:00
parent 49fb930c43
commit 252319848c
3 changed files with 9 additions and 10 deletions

View File

@@ -36,8 +36,8 @@ if [ "${ZABBIX_DATABASE}" != "psql" ] && [ "${ZABBIX_DATABASE}" != "mysql" ]; th
echo "[! $(date +'%F %T')] Zabbix dump must have database set to either psql or mysql";
exit 1;
fi;
if [ ! -f "${ZABBIX_DUMP}" ]; then
echo "[! $(date +'%F %T')] Zabbix dump script could not be found: ${ZABBIX_DUMP}";
if [ ! -f "${ZABBIX_DUMP_BIN}" ]; then
echo "[! $(date +'%F %T')] Zabbix dump script could not be found: ${ZABBIX_DUMP_BIN}";
exit 1;
fi;
# -i (ignore)/ -f (backup)
@@ -54,8 +54,8 @@ BACKUP_SET="zabbix-settings-${BACKUP_SET}";
BACKUP_SET_PREFIX="zabbix-settings-";
# borg call
BORG_CALL=$(echo "${_BORG_CALL}" | sed -e "s/##FILENAME##/${FILENAME}/" | sed -e "s|##REPOSITORY##|${REPOSITORY}|" | sed -e "s/##BACKUP_SET##/${BACKUP_SET}/");
BORG_PRUNE=$(echo "${_BORG_PRUNE}" | sed -e "s|##REPOSITORY##|${REPOSITORY}|" | sed -e "s/##BACKUP_SET_PREFIX##/${BACKUP_SET_PREFIX}/");
BORG_CALL=$(echo "${_BORG_CALL}" | sed -e "s/##FILENAME##/${FILENAME}/" | sed -e "s/##BACKUP_SET##/${BACKUP_SET}/");
BORG_PRUNE=$(echo "${_BORG_PRUNE}" | sed -e "s/##BACKUP_SET_PREFIX##/${BACKUP_SET_PREFIX}/");
# if prefix is emtpy remote "-P"
if [ -z "${BACKUP_SET_PREFIX}" ]; then
BORG_PRUNE=$(echo "${BORG_PRUNE}" | sed -e 's/-P //');