]> arthur.barton.de Git - backup-script.git/commitdiff
Don't detect "latest" symlink as latest backup generation
authorAlexander Barton <alex@barton.de>
Tue, 12 May 2015 09:32:01 +0000 (11:32 +0200)
committerAlexander Barton <alex@barton.de>
Tue, 12 May 2015 09:32:01 +0000 (11:32 +0200)
Problem introduced by commit f31ea55373 ('Create "latest" link to
latest generation').

bin/backup-script

index fb7f7accab90c95f8964a036760d77a7dd1513fd..8d5e25e45e8dfc65427c907a4a355894881d41f8 100755 (executable)
@@ -244,9 +244,8 @@ for f in $sys; do
                fi
 
                # Search directory of last generation, if any
-               last="`ls -1 "$sys_target" 2>/dev/null | sort -r | head -n1`"
+               last="`ls -1d "$sys_target"/[0-9]* 2>/dev/null | sort -r | head -n1`"
                if [ -n "$last" ]; then
-                       last="$sys_target/$last"
                        if [ ! -d "$last" ]; then
                                echo "Last snapshot \"$last\" seems not to be a directory!? \"$system\" skipped!"
                                echo; continue