use -d to prevent displaying the content of a directory

Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
This commit is contained in:
Nico Schottelius 2009-10-31 09:03:58 +01:00
parent 435f2140da
commit 9e801582d5

View file

@ -437,7 +437,7 @@ while [ "${i}" -lt "${no_sources}" ]; do
# *.marker: not possible, creates an error, if no *.marker exists # *.marker: not possible, creates an error, if no *.marker exists
# -> catch return value # -> 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 if [ "${ret}" -eq 0 ]; then
_techo "Incomplete backups: $(echo $(cat "${TMP}"))" _techo "Incomplete backups: $(echo $(cat "${TMP}"))"
@ -463,7 +463,7 @@ while [ "${i}" -lt "${no_sources}" ]; do
# Check: maximum number of backups is reached? # 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" | sed 's/^ *//g')" || _exit_err "Counting backups failed"
_techo "Existing backups: ${count} Total keeping backups: ${c_interval}" _techo "Existing backups: ${count} Total keeping backups: ${c_interval}"
@ -473,7 +473,7 @@ while [ "${i}" -lt "${no_sources}" ]; do
remove="$((${count} - ${substract}))" remove="$((${count} - ${substract}))"
_techo "Removing ${remove} backup(s)..." _techo "Removing ${remove} backup(s)..."
pcmd ls -${TSORT}1r "${ddir}/${INTERVAL}."*"/" | pcmd ls -${TSORT}d1r "${ddir}/${INTERVAL}."*"/" |
head -n "${remove}" > "${TMP}" || \ head -n "${remove}" > "${TMP}" || \
_exit_err "Listing old backups failed" _exit_err "Listing old backups failed"