Skip to content
Snippets Groups Projects
Commit b62ffd74 authored by Bob Mottram's avatar Bob Mottram
Browse files

Consolidate backup_apps

parent b0d94597
No related branches found
No related tags found
No related merge requests found
......@@ -249,26 +249,6 @@ function backup_directories {
done
}
function backup_apps {
FILES=/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-*
APPS_COMPLETED=()
# for all the app scripts
for filename in $FILES
do
app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
if [[ $(item_in_array ${app_name} ${APPS_COMPLETED[@]}) != 0 ]]; then
function_check app_is_installed
if [[ "$(app_is_installed $a)" == "1" ]]; then
APPS_COMPLETED+=("${app_name}")
function_check backup_local_${app_name}
backup_local_${app_name}
fi
fi
done
}
function remove_backup_directory {
if [ $1 ]; then
if [[ $1 == "remove" ]]; then
......@@ -420,7 +400,7 @@ check_storage_space_remaining
backup_users
prepare_directories
backup_directories
backup_apps
backup_apps local
backup_configuration
backup_admin_readme
backup_mariadb
......
......@@ -424,8 +424,7 @@ if [[ $TEST_MODE == "no" ]]; then
backup_mariadb
backup_certs
backup_mailing_list
backup_apps remote
backup_extra_directories
fi
......
......@@ -363,4 +363,23 @@ function backup_database_to_friend {
backup_directory_to_friend /root/temp${database_name}data ${database_name}data
}
function backup_apps {
localremote=$1
FILES=/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-*
BACKUP_APPS_COMPLETED=()
# for all the app scripts
for filename in $FILES
do
app_name=$(echo "${filename}" | awk -F '-app-' '{print $2}')
if [[ $(item_in_array ${app_name} ${BACKUP_APPS_COMPLETED[@]}) != 0 ]]; then
if [[ "$(app_is_installed $a)" == "1" ]]; then
BACKUP_APPS_COMPLETED+=("${app_name}")
backup_${localremote}_${app_name}
fi
fi
done
}
# NOTE: deliberately no exit 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment