diff --git a/src/freedombone-app-akaunting b/src/freedombone-app-akaunting index 4562f76a..0832c8e8 100755 --- a/src/freedombone-app-akaunting +++ b/src/freedombone-app-akaunting @@ -182,19 +182,55 @@ function upgrade_akaunting { function backup_local_akaunting { - echo -n '' + akaunting_path=/var/www/${AKAUNTING_DOMAIN_NAME}/htdocs + if [ -d $akaunting_path ]; then + suspend_site ${AKAUNTING_DOMAIN_NAME} + function_check backup_database_to_usb + backup_database_to_usb akaunting + backup_directory_to_usb $akaunting_path akaunting + restart_site + fi } function restore_local_akaunting { - echo -n '' + temp_restore_dir=/root/tempakaunting + akaunting_dir=/var/www/${AKAUNTING_DOMAIN_NAME}/htdocs + + suspend_site ${AKAUNTING_DOMAIN_NAME} + + function_check akaunting_create_database + akaunting_create_database + + restore_database akaunting ${AKAUNTING_DOMAIN_NAME} + chown www-data:www-data $akaunting_dir + + restart_site } function backup_remote_akaunting { - echo -n '' + akaunting_path=/var/www/${AKAUNTING_DOMAIN_NAME}/htdocs + if [ -d $akaunting_path ]; then + suspend_site ${AKAUNTING_DOMAIN_NAME} + function_check backup_database_to_friend + backup_database_to_friend akaunting + backup_directory_to_friend $akaunting_path akaunting + restart_site + fi } function restore_remote_akaunting { - echo -n '' + temp_restore_dir=/root/tempakaunting + akaunting_dir=/var/www/${AKAUNTING_DOMAIN_NAME}/htdocs + + suspend_site ${AKAUNTING_DOMAIN_NAME} + + function_check akaunting_create_database + akaunting_create_database + + restore_database_from_friend akaunting ${AKAUNTING_DOMAIN_NAME} + chown www-data:www-data $akaunting_dir + + restart_site } function remove_akaunting {