Allow interval per source to be overwritten to 0 to skip the source in this interval. #2

Open
skybeam wants to merge 3 commits from skybeam/ccollect:master into master
Showing only changes of commit ebded3049a - Show all commits

View file

@ -779,7 +779,7 @@ while [ "${source_no}" -lt "${no_sources}" ]; do
if [ "${remove}" -gt 0 ]; then
_techo "Removing ${remove} backup(s)..."
if [ -z "${ls_rm_exclude}" -o ${c_interval} -le 0 ]; then
if [ -z "${ls_rm_exclude}" -o ${c_interval} -eq 0 ]; then
Outdated
Review

If we want to match 0, we should do -eq 0, otherwise the documentation will need to be adjusted.

If we want to match 0, we should do `-eq 0`, otherwise the documentation will need to be adjusted.

Fine with me, usually errors are positive integers and I learned never ever to match numbers with "eq" - but for integers here it might be ok, so feel free to use -eq.

Fine with me, usually errors are positive integers and I learned never ever to match numbers with "eq" - but for integers here it might be ok, so feel free to use -eq.
# shellcheck disable=SC2010
ls -${TSORT}1r | grep "^${INTERVAL}\\." | head -n "${remove}" > "${TMP}" || \
_exit_err "Listing old backups failed"
@ -796,7 +796,7 @@ while [ "${source_no}" -lt "${no_sources}" ]; do
#
# Skip backup of this source if interval is zero.
#
if [ ${c_interval} -le 0 ]; then
if [ ${c_interval} -eq 0 ]; then
Outdated
Review

Same here

Same here
_techo "Skipping backup for this interval."
exit 0
fi