]> ruderich.org/simon Gitweb - config/dotfiles.git/commitdiff
bin/srsync-incremental: Only match directories when searching for --link-dest.
authorSimon Ruderich <simon@ruderich.org>
Wed, 29 Aug 2012 16:17:50 +0000 (18:17 +0200)
committerSimon Ruderich <simon@ruderich.org>
Wed, 29 Aug 2012 16:17:50 +0000 (18:17 +0200)
bin/srsync-incremental

index 62ab0d6e76cf0b2f4ac065693e1d0bff666806eb..aa2c977c056a2898c7ad0c7ac90acd947c6c202f 100755 (executable)
@@ -33,7 +33,8 @@ shift
 
 dest=`echo backup-*`
 if [ "x$dest" != 'xbackup-*' ]; then
-    dest="`pwd`/`ls -1d backup-* | tail -n1`"
+    # -F and grep is used to list only directories, zsh's *(/) would be great.
+    dest="`pwd`/`ls -1dF backup-* | grep / | tail -n1`"
 fi
 
 target=backup-`date '+%Y-%m-%d-%H-%M-%S'`