]> git.llucax.com Git - software/bacap.git/commitdiff
Fail if the BACKUP_DIR doesn't exist main
authorLeandro Lucarella <luca@llucax.com>
Sat, 25 Sep 2021 10:20:56 +0000 (12:20 +0200)
committerLeandro Lucarella <luca@llucax.com>
Sat, 25 Sep 2021 10:20:56 +0000 (12:20 +0200)
This avoids starting a backup when, for example, the backup dir lives in
an external volume and it is not mounted.

bacap

diff --git a/bacap b/bacap
index 30983f5dfe850edea82535c993b3cee7506ad7c8..c3b541bc1ceff804ba80b57d3b18dfb5cfe75a1a 100755 (executable)
--- a/bacap
+++ b/bacap
@@ -89,6 +89,14 @@ ping_host() {
        ping -c1 "$1" > /dev/null 2>&1
 }
 
+load_config
+
+if ! test -d "$BACKUP_PATH"
+then
+       error "BACKUP_PATH=$BACKUP_PATH doesn't exist!"
+       exit 1
+fi
+
 date=`date "+$DATE_FMT"`
 log
 log