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:
parent
4db6b78a13
commit
d6ea94c6dc
1 changed files with 8 additions and 16 deletions
24
ccollect.sh
24
ccollect.sh
|
@ -442,24 +442,16 @@ while [ "${i}" -lt "${no_sources}" ]; do
|
|||
#
|
||||
# Check for incomplete backups
|
||||
#
|
||||
pcmd ls -1 "$ddir/${INTERVAL}"*".${c_marker}" > "${TMP}" 2>/dev/null
|
||||
|
||||
i=0
|
||||
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}"
|
||||
pcmd ls -1 "$ddir/${INTERVAL}"*".${c_marker}" 2>/dev/null | while read marker; do
|
||||
incomplete="$(echo ${marker} | sed "s/\\.${c_marker}\$//")"
|
||||
_techo "Incomplete backup: ${incomplete}"
|
||||
if [ -f "${c_delete_incomplete}" ]; then
|
||||
_techo "Deleting ${realincomplete} ..."
|
||||
pcmd rm $VVERBOSE -rf "${ddir}/${realincomplete}" || \
|
||||
_exit_err "Removing ${realincomplete} failed."
|
||||
_techo "Deleting ${incomplete} ..."
|
||||
pcmd rm $VVERBOSE -rf "${incomplete}" || \
|
||||
_exit_err "Removing ${incomplete} failed."
|
||||
pcmd rm $VVERBOSE -f "${marker}" || \
|
||||
_exit_err "Removing ${marker} failed."
|
||||
fi
|
||||
j=$(($j+1))
|
||||
done
|
||||
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue