Use destination dir basename

This commit is contained in:
Darko Poljak 2019-10-17 08:06:13 +02:00
parent c39205d308
commit 7701bdb0a8

View file

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