rewrite get incomplete backups code

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-01-15 02:35:49 +01:00
parent 05de81e0f0
commit 4675bf864c

View file

@ -425,13 +425,14 @@ while [ "${source_no}" -lt "${no_sources}" ]; do
# #
# Check incomplete backups (needs echo to remove newlines) # Check incomplete backups (needs echo to remove newlines)
# #
ls -1 | grep "${CMARKER}\$" > "${TMP}" || \ ls -1 | grep "${CMARKER}\$" > "${TMP}"; ret=$?
_exit_err "Cannot list incomplete files"
if [ "$ret" -eq 0 ]; then
_techo "Incomplete backups: $(echo $(cat "${TMP}"))" _techo "Incomplete backups: $(echo $(cat "${TMP}"))"
if [ -f "${c_delete_incomplete}" ]; then if [ -f "${c_delete_incomplete}" ]; then
delete_from_file "${TMP}" "${CMARKER}" delete_from_file "${TMP}" "${CMARKER}"
fi fi
fi
# #
# Check: maximum number of backups is reached? # Check: maximum number of backups is reached?