Merge branch 'master' into 'master'

Add 'current' symlink to backup destinations

See merge request ungleich-public/ccollect!15
This commit is contained in:
poljakowski 2020-05-25 17:51:13 +02:00
commit fabdefad82
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
#