From 6fd22b641697ecbbb0bbfc1eab1301836f44c191 Mon Sep 17 00:00:00 2001 From: jll2 Date: Fri, 26 Jun 2009 15:22:09 -0700 Subject: [PATCH] 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. --- ccollect.sh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/ccollect.sh b/ccollect.sh index 71c032b..a61af21 100755 --- a/ccollect.sh +++ b/ccollect.sh @@ -332,19 +332,6 @@ while [ "${i}" -lt "${no_sources}" ]; do 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 # @@ -464,6 +451,19 @@ while [ "${i}" -lt "${no_sources}" ]; do fi 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 # use grep and ls -p so we only look at directories