Bug fix for no keep options set check

This commit is contained in:
2022-03-31 11:01:02 +09:00
parent 77977207c8
commit f128b7ebc4

View File

@@ -133,12 +133,14 @@ if [ ! -w "${HOME}" ] || [ "${HOME}" = '/' ]; then
fi; fi;
# keep optionfs (for files) # keep optionfs (for files)
KEEP_OPTIONS=(""); KEEP_OPTIONS=();
# keep info string (for files) # keep info string (for files)
KEEP_INFO=""; KEEP_INFO="";
# override standard keep for tagged backups # override standard keep for tagged backups
if [ ! -z "${ONE_TIME_TAG}" ]; then if [ ! -z "${ONE_TIME_TAG}" ]; then
BACKUP_SET="{now:%Y-%m-%dT%H:%M:%S}"; BACKUP_SET="{now:%Y-%m-%dT%H:%M:%S}";
# set empty to avoid problems
KEEP_OPTIONS=("");
else else
# build options and info string, # build options and info string,
# also flag BACKUP_SET check if hourly is set # also flag BACKUP_SET check if hourly is set
@@ -182,7 +184,7 @@ else
fi; fi;
fi; fi;
# abort if KEEP_OPTIONS is empty # abort if KEEP_OPTIONS is empty
if [ -z "${KEEP_OPTIONS}" ]; then if [ "${#KEEP_OPTIONS[@]}" -eq "0" ]; then
echo "[! $(date +'%F %T')] It seems no KEEP_* entries where set in a valid format."; echo "[! $(date +'%F %T')] It seems no KEEP_* entries where set in a valid format.";
exit 1; exit 1;
fi; fi;
@@ -197,7 +199,6 @@ else
fi; fi;
fi; fi;
# for folders list split set to "#" and keep the old setting as is # for folders list split set to "#" and keep the old setting as is
_IFS=${IFS}; _IFS=${IFS};
IFS="#"; IFS="#";