simplify backup removal code

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-01-15 02:41:22 +01:00
parent aaf43af0d9
commit 7b65687da5
1 changed files with 1 additions and 2 deletions

View File

@ -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}" || \