find latest link-dest

This commit is contained in:
olli 2022-12-07 08:56:35 +01:00
parent 105f8c90da
commit 6680c95e64

View File

@ -115,7 +115,7 @@ Nextcloud/
BACKUPSRVPATH_WITH_DATE="$BACKUPSRVPATH_WITH_HOST/backup-$(date +%Y-%m-%d)/$BACKUPDIR"
BACKUPSRVPATH_WITH_DATE_INCOMPLETE="$BACKUPSRVPATH_WITH_DATE-incomplete"
g_runcmd $sshopts mkdir -p "$BACKUPSRVPATH_WITH_DATE_INCOMPLETE" || continue
BACKUPSRVPATH_LINK_DEST="$($sshopts ls -d "$BACKUPSRVPATH_WITH_HOST/backup-*/$BACKUPDIR" 2>/dev/null | egrep -v incomplete$ | tail -n1)"
BACKUPSRVPATH_LINK_DEST="$($sshopts ls -dtr1 "$BACKUPSRVPATH_WITH_HOST/backup-*/$BACKUPDIR" 2>/dev/null | tail -n1)"
# linkdest
[ -n "$BACKUPSRVPATH_LINK_DEST" ] && rsyncoptsrun="$rsyncoptsrun --link-dest=$BACKUPSRVPATH_LINK_DEST"
else