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}." #