simplify backup removal code
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
parent
aaf43af0d9
commit
7b65687da5
1 changed files with 1 additions and 2 deletions
3
ccollect
3
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}" || \
|
||||
|
|
Loading…
Reference in a new issue