From: Simon Ruderich Date: Wed, 29 Aug 2012 16:17:50 +0000 (+0200) Subject: bin/srsync-incremental: Only match directories when searching for --link-dest. X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=71bd44e6c82a82f3f0ca868c93217f6c522b5d22;p=config%2Fdotfiles.git bin/srsync-incremental: Only match directories when searching for --link-dest. --- diff --git a/bin/srsync-incremental b/bin/srsync-incremental index 62ab0d6..aa2c977 100755 --- a/bin/srsync-incremental +++ b/bin/srsync-incremental @@ -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'`