2017-06-17 17:28:57 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Source YunoHost helpers
|
2020-07-01 17:14:15 +02:00
|
|
|
source ../settings/scripts/_common.sh
|
2017-06-17 17:28:57 +02:00
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2018-11-25 18:38:33 +01:00
|
|
|
ynh_abort_if_errors
|
|
|
|
|
2017-06-17 17:28:57 +02:00
|
|
|
# Get multi-instances specific variables
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
|
|
|
|
# Set app specific variables
|
|
|
|
dbname=$app
|
|
|
|
dbuser=$app
|
|
|
|
|
|
|
|
INSTALL_DIR=/opt/yunohost/ihatemoney
|
|
|
|
|
|
|
|
# Retrieve app settings
|
|
|
|
domain=$(ynh_app_setting_get "$app" domain)
|
|
|
|
path=$(ynh_app_setting_get "$app" path)
|
|
|
|
dbpass=$(ynh_app_setting_get "$app" mysqlpwd)
|
|
|
|
|
|
|
|
# Backup conf files
|
|
|
|
mkdir ./conf
|
|
|
|
ynh_backup "$nginx_conf_path" "conf/nginx.conf"
|
|
|
|
ynh_backup "$gunicorn_conf_path" "conf/gunicorn.conf.py"
|
|
|
|
ynh_backup "$supervisor_conf_path" "conf/supervisor.conf"
|
2017-06-21 13:30:48 +02:00
|
|
|
ynh_backup "$ihatemoney_conf_path" "conf/ihatemoney.cfg"
|
2017-06-17 17:28:57 +02:00
|
|
|
|
|
|
|
# Dump the database
|
|
|
|
mysqldump -u "$dbuser" -p"$dbpass" --no-create-db "$dbname" > ./db.sql
|
|
|
|
|
|
|
|
# Backup code and venv
|
|
|
|
ynh_backup "$INSTALL_DIR" "install_dir"
|