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