Add 'current' symlink to backup destinations

This commit is contained in:
Steffen Zieger 2020-05-25 16:16:32 +02:00
parent 7a7dec7751
commit 616b1d9e3e
1 changed files with 10 additions and 0 deletions

View File

@ -861,6 +861,16 @@ while [ "${source_no}" -lt "${no_sources}" ]; do
_techo "Warning: rsync failed with return code $ret."
fi
#
# Create symlink to newest backup
#
# shellcheck disable=SC2010
latest_dir="$(ls -${TSORT}p1 "${ddir}" | grep '/$' | head -n 1)" || \
_exit_err "Failed to list content of ${ddir}."
ln -snf "${ddir}${latest_dir}" "${ddir}current" || \
_exit_err "Failed to create 'current' symlink."
#
# post_exec
#