diff --git a/ccollect b/ccollect index af7a2c1..35d2071 100755 --- a/ccollect +++ b/ccollect @@ -753,8 +753,10 @@ while [ "${source_no}" -lt "${no_sources}" ]; do # # Check for backup directory to clone from: Always clone from the latest one! + # Exclude destination_dir from listing, it can be touched reused and renamed + # oldest existing destination directory. # - last_dir="$(ls -${TSORT}p1 | grep '/$' | head -n 1)" || \ + last_dir="$(ls -${TSORT}p1 | grep '/$' | grep -v "${destination_dir}" | head -n 1)" || \ _exit_err "Failed to list contents of ${ddir}." #