with -tcp1 need to head -n1, not tail -n1 anymore

This commit is contained in:
Nico Schottelius 2007-08-17 23:50:40 +02:00
parent 2c80eab8e1
commit fd6a50a36b
2 changed files with 10 additions and 9 deletions

View file

@ -424,12 +424,9 @@ while [ "${i}" -lt "${no_sources}" ]; do
# Use ls -1c instead of -1t, because last modification maybe the same on all # Use ls -1c instead of -1t, because last modification maybe the same on all
# and metadate update (-c) is updated by rsync locally. # and metadate update (-c) is updated by rsync locally.
# #
rel_last_dir="$(cd "${c_dest}" && ls -tcp1 | grep '/$' | head -n 1)" || \
set -x
#last_dir="$(ls -d "${c_dest}/${INTERVAL}."?* 2>/dev/null | sort -n | tail -n 1)"
last_dir="$(cd "${c_dest}" && ls -pc1 | grep '/$' | tail -n 1)" || \
_exit_err "Failed to list contents of ${c_dest}." _exit_err "Failed to list contents of ${c_dest}."
set +x last_dir="${c_dest}/${rel_last_dir}"
# #
# clone from old backup, if existing # clone from old backup, if existing
@ -438,6 +435,7 @@ while [ "${i}" -lt "${no_sources}" ]; do
abs_last_dir="$(cd "${last_dir}" && pwd -P)" || \ abs_last_dir="$(cd "${last_dir}" && pwd -P)" || \
_exit_err "Could not change to last dir ${last_dir}." _exit_err "Could not change to last dir ${last_dir}."
set -- "$@" "--link-dest=${abs_last_dir}" set -- "$@" "--link-dest=${abs_last_dir}"
_techo "Hard linking from ${rel_last_dir}"
fi fi

View file

@ -1,7 +1,3 @@
- Improve finding backup from another interval:
o strip of interval name
o run sort -n
o use the last entry
- do not delete_incomplete, when there's only one backup left! - do not delete_incomplete, when there's only one backup left!
- Add filter support - Add filter support
* filter * filter
@ -10,3 +6,10 @@
- add source/ignore_failed_pre_exec - add source/ignore_failed_pre_exec
- add source/ignore_failed_post_exec - add source/ignore_failed_post_exec
- .ccollect-marker is deleted by rsync at the beginning! - .ccollect-marker is deleted by rsync at the beginning!
- fix marking
Done:
- Improve finding backup from another interval:
o strip of interval name
o run sort -n
o use the last entry