Some cleanups

This commit is contained in:
Nico Schottelius 2007-08-16 21:25:46 +02:00
parent a35e31e86c
commit e2a143e0b6

View file

@ -384,26 +384,19 @@ while [ "${i}" -lt "${no_sources}" ]; do
# #
# Check for incomplete backups # Check for incomplete backups
# #
( ( cd "${c_dest}" 2>/dev/null && ls -1 "${INTERVAL}"*/${c_marker} > "${TMP}" 2>/dev/null)
set -e
# FIXME: debug
set -x
cd "${c_dest}"
# one column output to ${TMP}
ls -1 "${INTERVAL}"*/${c_marker} > "${TMP}"
# FIXME: debug # FIXME: debug
cat "${TMP}" cat "${TMP}"
while read incomplete; do while read incomplete; do
realincomplete=$(echo ${incomplete} | sed "s/${c_marker}\$//") realincomplete=$(echo ${incomplete} | sed "s/${c_marker}\$//")
_techo "Incomplete backup: ${realincomplete}" _techo "Incomplete backup: ${realincomplete}"
if [ "$DELETE_INCOMPLETE" = "yes" ]; then if [ "${DELETE_INCOMPLETE}" = "yes" ]; then
_techo "Deleting ${realincomplete}" _techo "Deleting ${realincomplete} ..."
echo rm $VVERBOSE -rf "${realincomplete}" rm $VVERBOSE -rf "${c_dest}/${realincomplete}"
fi fi
done < "${TMP}" done < "${TMP}"
) || _exit_err "Searching for incomplete backups failed."
# #
@ -441,6 +434,7 @@ while [ "${i}" -lt "${no_sources}" ]; do
# try our interval # try our interval
set -x set -x
last_dir="$(ls -d "${c_dest}/${INTERVAL}."?* 2>/dev/null | sort -n | tail -n 1)" last_dir="$(ls -d "${c_dest}/${INTERVAL}."?* 2>/dev/null | sort -n | tail -n 1)"
set +x
# try other intervals, if there's none four our interval # try other intervals, if there's none four our interval
if [ -z "${last_dir}" ]; then if [ -z "${last_dir}" ]; then
@ -501,6 +495,7 @@ while [ "${i}" -lt "${no_sources}" ]; do
set -x set -x
rsync "$@" "${source}" "${abs_destination_dir}"; ret=$? rsync "$@" "${source}" "${abs_destination_dir}"; ret=$?
set +x
# #
# remove marking here # remove marking here