From 9281605a7d6ce9ec39c13371878dbf0e80cc4677 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 22 Sep 2015 19:33:20 +0100 Subject: [PATCH] don't backup non-existent directories --- src/freedombone | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/freedombone b/src/freedombone index 3790da16..6bfb8881 100755 --- a/src/freedombone +++ b/src/freedombone @@ -2416,6 +2416,11 @@ function get_mariadb_owncloud_admin_password { } function backup_directory_to_usb { + if [ ! -d ${1} ]; then + echo "WARNING: directory does not exist: ${1}" + return + fi + if [[ $BACKUP_TYPE == 'obnam' ]]; then BACKUP_KEY_EXISTS=$(gpg --list-keys "$MY_NAME (backup key)") if [ ! "$?" = "0" ]; then