Move "interval definition section".
The interval definition section was down to just before the maximum backup check. This makes the code more friendly to automatic interval selection. Auto interval selection needs to have ddir defined first and it is best if it is done after delete_incomplete. This change accomplishes that while still placing it before the maximum backup check which needs to know the interval.
This commit is contained in:
parent
72830a4647
commit
6fd22b6416
1 changed files with 13 additions and 13 deletions
26
ccollect.sh
26
ccollect.sh
|
@ -332,19 +332,6 @@ while [ "${i}" -lt "${no_sources}" ]; do
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
|
||||||
# interval definition: First try source specific, fallback to default
|
|
||||||
#
|
|
||||||
c_interval="$(cat "${backup}/intervals/${INTERVAL}" 2>/dev/null)"
|
|
||||||
|
|
||||||
if [ -z "${c_interval}" ]; then
|
|
||||||
c_interval="$(cat "${CDEFAULTS}/intervals/${INTERVAL}" 2>/dev/null)"
|
|
||||||
|
|
||||||
if [ -z "${c_interval}" ]; then
|
|
||||||
_exit_err "No definition for interval \"${INTERVAL}\" found. Skipping."
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Source checks
|
# Source checks
|
||||||
#
|
#
|
||||||
|
@ -464,6 +451,19 @@ while [ "${i}" -lt "${no_sources}" ]; do
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
#
|
||||||
|
# interval definition: First try source specific, fallback to default
|
||||||
|
#
|
||||||
|
c_interval="$(cat "${backup}/intervals/${INTERVAL}" 2>/dev/null)"
|
||||||
|
|
||||||
|
if [ -z "${c_interval}" ]; then
|
||||||
|
c_interval="$(cat "${CDEFAULTS}/intervals/${INTERVAL}" 2>/dev/null)"
|
||||||
|
|
||||||
|
if [ -z "${c_interval}" ]; then
|
||||||
|
_exit_err "No definition for interval \"${INTERVAL}\" found. Skipping."
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
# check if maximum number of backups is reached, if so remove
|
# check if maximum number of backups is reached, if so remove
|
||||||
# use grep and ls -p so we only look at directories
|
# use grep and ls -p so we only look at directories
|
||||||
|
|
Loading…
Reference in a new issue