From 9e801582d53efd7d4fba00780f34620824c6834c Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 31 Oct 2009 09:03:58 +0100 Subject: [PATCH] use -d to prevent displaying the content of a directory Signed-off-by: Nico Schottelius --- ccollect.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ccollect.sh b/ccollect.sh index a0c6489..0247c00 100755 --- a/ccollect.sh +++ b/ccollect.sh @@ -437,7 +437,7 @@ while [ "${i}" -lt "${no_sources}" ]; do # *.marker: not possible, creates an error, if no *.marker exists # -> catch return value - pcmd ls -1 "${ddir}/"*"${CMARKER}" > "${TMP}" 2>/dev/null; ret=$? + pcmd ls -d1 "${ddir}/"*"${CMARKER}" > "${TMP}" 2>/dev/null; ret=$? if [ "${ret}" -eq 0 ]; then _techo "Incomplete backups: $(echo $(cat "${TMP}"))" @@ -463,7 +463,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 -d1 "${ddir}/${INTERVAL}."*"/" | wc -l \ | sed 's/^ *//g')" || _exit_err "Counting backups failed" _techo "Existing backups: ${count} Total keeping backups: ${c_interval}" @@ -473,7 +473,7 @@ while [ "${i}" -lt "${no_sources}" ]; do remove="$((${count} - ${substract}))" _techo "Removing ${remove} backup(s)..." - pcmd ls -${TSORT}1r "${ddir}/${INTERVAL}."*"/" | + pcmd ls -${TSORT}d1r "${ddir}/${INTERVAL}."*"/" | head -n "${remove}" > "${TMP}" || \ _exit_err "Listing old backups failed"