From 2a6ab4c125398f917c26f161d361f226a4da6bba Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 30 Oct 2009 19:49:17 +0100 Subject: [PATCH] adjust ls for existing backups to new delete_from_file behaviour Signed-off-by: Nico Schottelius --- ccollect.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ccollect.sh b/ccollect.sh index 2fe7a33..5697003 100755 --- a/ccollect.sh +++ b/ccollect.sh @@ -457,9 +457,8 @@ while [ "${i}" -lt "${no_sources}" ]; do # # Check: maximum number of backups is reached? - # If so remove. Use grep and ls -p so we only look at directories # - count="$(pcmd ls -p1 "${ddir}" | grep "^${INTERVAL}\..*/\$" | wc -l \ + count="$(pcmd ls -p1 "${ddir}/${INTERVAL}.*/" | wc -l \ | sed 's/^ *//g')" || _exit_err "Counting backups failed" _techo "Existing backups: ${count} Total keeping backups: ${c_interval}"