From 145c6de2fb75156f8805ddaac90f647f679b25f2 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 31 Oct 2009 07:40:55 +0100 Subject: [PATCH] double check quotes, remove grep Signed-off-by: Nico Schottelius --- ccollect.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ccollect.sh b/ccollect.sh index 6395004..bac7f2f 100755 --- a/ccollect.sh +++ b/ccollect.sh @@ -459,7 +459,7 @@ while [ "${i}" -lt "${no_sources}" ]; do # Check: maximum number of backups is reached? # - count="$(pcmd ls -1 "${ddir}/${INTERVAL}.*/" | wc -l \ + count="$(pcmd ls -1 "${ddir}/${INTERVAL}."*"/" | wc -l \ | sed 's/^ *//g')" || _exit_err "Counting backups failed" _techo "Existing backups: ${count} Total keeping backups: ${c_interval}" @@ -469,9 +469,9 @@ while [ "${i}" -lt "${no_sources}" ]; do remove="$((${count} - ${substract}))" _techo "Removing ${remove} backup(s)..." - pcmd ls -${TSORT}p1r "${ddir}" | grep "^${INTERVAL}\..*/\$" | \ - head -n "${remove}" > "${TMP}" || \ - _exit_err "Listing old backups failed" + pcmd ls -${TSORT}1r "${ddir}/${INTERVAL}."*"/" | + head -n "${remove}" > "${TMP}" || \ + _exit_err "Listing old backups failed" delete_from_file "${TMP}" fi