]> arthur.barton.de Git - backup-script.git/commitdiff
backup-script: Correctly detect empty system directories on Btrfs github/master
authorAlexander Barton <alex@barton.de>
Wed, 23 Nov 2022 14:48:06 +0000 (15:48 +0100)
committerAlexander Barton <alex@barton.de>
Wed, 23 Nov 2022 14:48:06 +0000 (15:48 +0100)
bin/backup-script

index 3d3db8512592bf45fd1217afd98b869c67717ead..16c30a1edb5afeb225196bcb545f202522f55699 100755 (executable)
@@ -249,6 +249,7 @@ Initialize_Last_SysTarget_Snapshot() {
                # Search directory of last generation, if any
                # shellcheck disable=SC2012
                last=$(ls -1d "$sys_target"/[0-9]* 2>/dev/null | sort -r | head -n1)
+               [[ "$last" != "." ]] || unset last
                if [ -n "$last" ]; then
                        if [ ! -d "$last" ]; then
                                ErrorMsg "Last snapshot \"$last\" seems not to be a directory!? \"$system\" skipped!"