Exclude destintion dir from listing for last dir

This commit is contained in:
Darko Poljak 2019-10-17 08:03:12 +02:00
parent 2788de47b8
commit c39205d308

View file

@ -753,8 +753,10 @@ while [ "${source_no}" -lt "${no_sources}" ]; do
# #
# Check for backup directory to clone from: Always clone from the latest one! # 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}." _exit_err "Failed to list contents of ${ddir}."
# #