Backup and restore of akaunting

This commit is contained in:
Bob Mottram 2017-12-20 21:38:00 +00:00
parent 0c926f1b7a
commit 7658403fcc
1 changed files with 40 additions and 4 deletions

View File

@ -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 {