From 7701bdb0a87413bc756ea408656e32d65d7dfb20 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Thu, 17 Oct 2019 08:06:13 +0200 Subject: [PATCH] Use destination dir basename --- ccollect | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ccollect b/ccollect index 35d2071..f5aa145 100755 --- a/ccollect +++ b/ccollect @@ -756,7 +756,8 @@ while [ "${source_no}" -lt "${no_sources}" ]; do # Exclude destination_dir from listing, it can be touched reused and renamed # oldest existing destination directory. # - last_dir="$(ls -${TSORT}p1 | grep '/$' | grep -v "${destination_dir}" | head -n 1)" || \ + dest_dir_name=$(basename "${destination_dir}") + last_dir="$(ls -${TSORT}p1 | grep '/$' | grep -v "${dest_dir_name}" | head -n 1)" || \ _exit_err "Failed to list contents of ${ddir}." #