From: Leandro Lucarella Date: Sat, 25 Sep 2021 10:20:56 +0000 (+0200) Subject: Fail if the BACKUP_DIR doesn't exist X-Git-Url: https://git.llucax.com/software/bacap.git/commitdiff_plain/41a60dbc119316ad2de8da2700077a47367daad6 Fail if the BACKUP_DIR doesn't exist This avoids starting a backup when, for example, the backup dir lives in an external volume and it is not mounted. --- diff --git a/bacap b/bacap index 30983f5..c3b541b 100755 --- 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