Check that database backup exists

This commit is contained in:
Bob Mottram 2018-01-24 17:03:14 +00:00
parent 57cc40019d
commit b20eec16df
2 changed files with 9 additions and 9 deletions

View File

@ -169,9 +169,7 @@ function restore_local_rss {
function_check get_mariadb_password
get_mariadb_password
function_check rss_create_database
rss_create_database
function_check restore_database
restore_database ttrss
if [ -d /etc/share/tt-rss ]; then
@ -252,10 +250,6 @@ function restore_remote_rss {
get_mariadb_password
function_check restore_database_from_friend
function_check rss_create_database
rss_create_database
restore_database_from_friend ttrss
if [ -d /etc/share/tt-rss ]; then

View File

@ -583,7 +583,7 @@ function restore_database_from_friend {
DATABASE_PASSWORD=
RESTORE_SUBDIR="root"
if [ -d $SERVER_DIRECTORY/backup/${1} ]; then
if [ -d $SERVER_DIRECTORY/backup/${1}data ]; then
database_file_extension='sql'
if [ $USE_MONGODB ]; then
database_file_extension='mdb'
@ -666,6 +666,9 @@ function restore_database_from_friend {
fi
fi
fi
else
echo $"No database backup found for ${1}"
exit 6239353
fi
}
@ -674,7 +677,7 @@ function restore_database {
restore_app_name=$1
restore_app_domain=$2
if [ -d $USB_MOUNT/backup/${restore_app_name} ]; then
if [ -d $USB_MOUNT/backup/${restore_app_name}data ]; then
echo $"Restoring ${restore_app_name} database"
local_database_dir=/root/temp${restore_app_name}data
if [ -d ${local_database_dir} ]; then
@ -776,6 +779,9 @@ function restore_database {
fi
fi
fi
else
echo $"No database backup found for ${restore_app_name}"
exit 7357224
fi
}