From 7b65687da57df2e1e1ce62988f4a10cae250489d Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 15 Jan 2011 02:41:22 +0100 Subject: [PATCH] simplify backup removal code Signed-off-by: Nico Schottelius --- ccollect | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ccollect b/ccollect index 1cd295d..5a254da 100755 --- a/ccollect +++ b/ccollect @@ -442,8 +442,7 @@ while [ "${source_no}" -lt "${no_sources}" ]; do _techo "Existing backups: ${count} Total keeping backups: ${c_interval}" if [ "${count}" -ge "${c_interval}" ]; then - substract="$((${c_interval} - 1))" - remove="$((${count} - ${substract}))" + remove="$((${count} - ${c_interval} + 1))" _techo "Removing ${remove} backup(s)..." ls -${TSORT}d1r | grep "${INTERVAL}\\." | head -n "${remove}" > "${TMP}" || \