From 41a60dbc119316ad2de8da2700077a47367daad6 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Sat, 25 Sep 2021 12:20:56 +0200 Subject: [PATCH 1/1] 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. --- bacap | 8 ++++++++ 1 file changed, 8 insertions(+) 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 -- 2.43.0