Simplify interval code.
Eight lines and two variables are removed which makes the code, I think, easier to read. The main motivation for this change, however, is that it makes ccollect.sh more friendly to (future) auto interval selection. The removed lines and variables assumed that the interval was known prior to the start of the source loop. With auto interval selection, the selected interval can be different for each source.
This commit is contained in:
parent
0b064e0565
commit
76e6094247
1 changed files with 1 additions and 9 deletions
10
ccollect.sh
10
ccollect.sh
|
@ -237,14 +237,6 @@ if [ -x "${CPREEXEC}" ]; then
|
|||
[ "${ret}" -eq 0 ] || _exit_err "${CPREEXEC} failed. Aborting"
|
||||
fi
|
||||
|
||||
#
|
||||
# check default configuration
|
||||
#
|
||||
|
||||
D_FILE_INTERVAL="${CDEFAULTS}/intervals/${INTERVAL}"
|
||||
D_INTERVAL=$(cat "${D_FILE_INTERVAL}" 2>/dev/null)
|
||||
|
||||
|
||||
#
|
||||
# Let's do the backup
|
||||
#
|
||||
|
@ -346,7 +338,7 @@ while [ "${i}" -lt "${no_sources}" ]; do
|
|||
c_interval="$(cat "${backup}/intervals/${INTERVAL}" 2>/dev/null)"
|
||||
|
||||
if [ -z "${c_interval}" ]; then
|
||||
c_interval="${D_INTERVAL}"
|
||||
c_interval="$(cat "${CDEFAULTS}/intervals/${INTERVAL}" 2>/dev/null)"
|
||||
|
||||
if [ -z "${c_interval}" ]; then
|
||||
_exit_err "No definition for interval \"${INTERVAL}\" found. Skipping."
|
||||
|
|
Loading…
Reference in a new issue