double check quotes, remove grep

Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
This commit is contained in:
Nico Schottelius 2009-10-31 07:40:55 +01:00
parent 1b591a040c
commit 145c6de2fb

View file

@ -459,7 +459,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 -1 "${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}"
@ -469,9 +469,9 @@ 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}p1r "${ddir}" | grep "^${INTERVAL}\..*/\$" | \ pcmd ls -${TSORT}1r "${ddir}/${INTERVAL}."*"/" |
head -n "${remove}" > "${TMP}" || \ head -n "${remove}" > "${TMP}" || \
_exit_err "Listing old backups failed" _exit_err "Listing old backups failed"
delete_from_file "${TMP}" delete_from_file "${TMP}"
fi fi