From fd6a50a36b80d7b803b4753da485e0c6658c8ac6 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 17 Aug 2007 23:50:40 +0200 Subject: [PATCH] with -tcp1 need to head -n1, not tail -n1 anymore --- ccollect.sh | 8 +++----- doc/todo/0.6.1 | 11 +++++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/ccollect.sh b/ccollect.sh index c20c23d..0927f22 100755 --- a/ccollect.sh +++ b/ccollect.sh @@ -424,12 +424,9 @@ while [ "${i}" -lt "${no_sources}" ]; do # Use ls -1c instead of -1t, because last modification maybe the same on all # and metadate update (-c) is updated by rsync locally. # - - 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)" || \ + rel_last_dir="$(cd "${c_dest}" && ls -tcp1 | grep '/$' | head -n 1)" || \ _exit_err "Failed to list contents of ${c_dest}." - set +x + last_dir="${c_dest}/${rel_last_dir}" # # clone from old backup, if existing @@ -438,6 +435,7 @@ while [ "${i}" -lt "${no_sources}" ]; do abs_last_dir="$(cd "${last_dir}" && pwd -P)" || \ _exit_err "Could not change to last dir ${last_dir}." set -- "$@" "--link-dest=${abs_last_dir}" + _techo "Hard linking from ${rel_last_dir}" fi diff --git a/doc/todo/0.6.1 b/doc/todo/0.6.1 index c4a39d5..619beeb 100644 --- a/doc/todo/0.6.1 +++ b/doc/todo/0.6.1 @@ -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! - Add filter support * filter @@ -10,3 +6,10 @@ - add source/ignore_failed_pre_exec - add source/ignore_failed_post_exec - .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