Fix delete_incomplete bugs:

1).  On systems I tried, delete_incomplete failed because the line:

< pcmd rm $VVERBOSE -rf "${ddir}/${realincomplete}" || \

should read:

> pcmd rm $VVERBOSE -rf "${realincomplete}" || \

(Is this true of all systems?)

2).  The marker file was not deleted.  Code was added to delete it.

3).  The delete_incomplete code was simplified.
This commit is contained in:
jll2 2009-06-15 20:16:25 -07:00 committed by Nico Schottelius
parent 4db6b78a13
commit d6ea94c6dc

View file

@ -442,24 +442,16 @@ while [ "${i}" -lt "${no_sources}" ]; do
# #
# Check for incomplete backups # Check for incomplete backups
# #
pcmd ls -1 "$ddir/${INTERVAL}"*".${c_marker}" > "${TMP}" 2>/dev/null pcmd ls -1 "$ddir/${INTERVAL}"*".${c_marker}" 2>/dev/null | while read marker; do
incomplete="$(echo ${marker} | sed "s/\\.${c_marker}\$//")"
i=0 _techo "Incomplete backup: ${incomplete}"
while read incomplete; do
eval incomplete_$i=\"$(echo ${incomplete} | sed "s/\\.${c_marker}\$//")\"
i=$(($i+1))
done < "${TMP}"
j=0
while [ "$j" -lt "$i" ]; do
eval realincomplete=\"\$incomplete_$j\"
_techo "Incomplete backup: ${realincomplete}"
if [ -f "${c_delete_incomplete}" ]; then if [ -f "${c_delete_incomplete}" ]; then
_techo "Deleting ${realincomplete} ..." _techo "Deleting ${incomplete} ..."
pcmd rm $VVERBOSE -rf "${ddir}/${realincomplete}" || \ pcmd rm $VVERBOSE -rf "${incomplete}" || \
_exit_err "Removing ${realincomplete} failed." _exit_err "Removing ${incomplete} failed."
pcmd rm $VVERBOSE -f "${marker}" || \
_exit_err "Removing ${marker} failed."
fi fi
j=$(($j+1))
done done
# #