From 8f71f32aa3e89e59258a90b93c79a7280397e8c5 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sat, 7 Dec 2013 21:22:15 +0100 Subject: [PATCH] bin/srsync-incremental: Improve --link-dest search. --- bin/srsync-incremental | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/srsync-incremental b/bin/srsync-incremental index 909c028..16aa88a 100755 --- a/bin/srsync-incremental +++ b/bin/srsync-incremental @@ -34,11 +34,11 @@ fi cd "$1" || exit 1 shift -dest=`echo backup-*` -if test "x$dest" != 'xbackup-*'; then - # -F and grep is used to list only directories, zsh's *(/) would be great. - dest="`pwd`/`ls -1dF backup-* | grep / | tail -n1`" -fi +# Get absolute path to last backup directory. +for x in backup-*; do + test -d "$x" || continue + dest="../$x" # relative to destination directory +done target=backup-`date '+%Y-%m-%d-%H-%M-%S'` -- 2.45.2