simplify backup counting code

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-01-15 02:31:46 +01:00
parent 51db5e1204
commit 05de81e0f0

View file

@ -436,7 +436,7 @@ while [ "${source_no}" -lt "${no_sources}" ]; do
#
# Check: maximum number of backups is reached?
#
count="$(ls -1 | grep "^${INTERVAL}\\." | wc -l | sed 's/^ *//g')" \
count="$(ls -1 | grep -c "^${INTERVAL}\\.")" \
|| _exit_err "Counting backups failed"
_techo "Existing backups: ${count} Total keeping backups: ${c_interval}"