don't backup non-existent directories

This commit is contained in:
Bob Mottram 2015-09-22 19:33:20 +01:00
parent 2e2d55c058
commit 22cd2dda75
1 changed files with 5 additions and 0 deletions

View File

@ -2416,6 +2416,11 @@ function get_mariadb_owncloud_admin_password {
} }
function backup_directory_to_usb { function backup_directory_to_usb {
if [ ! -d ${1} ]; then
echo "WARNING: directory does not exist: ${1}"
return
fi
if [[ $BACKUP_TYPE == 'obnam' ]]; then if [[ $BACKUP_TYPE == 'obnam' ]]; then
BACKUP_KEY_EXISTS=$(gpg --list-keys "$MY_NAME (backup key)") BACKUP_KEY_EXISTS=$(gpg --list-keys "$MY_NAME (backup key)")
if [ ! "$?" = "0" ]; then if [ ! "$?" = "0" ]; then