#!/bin/bash # Source YunoHost helpers source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers ynh_abort_if_errors # 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 "/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup "$gunicorn_conf_path" ynh_backup "$supervisor_conf_path" ynh_backup "$ihatemoney_conf_path" # Dump the database mysqldump -u "$dbuser" -p"$dbpass" --no-create-db "$dbname" > ./db.sql # Backup code and venv ynh_backup "$INSTALL_DIR" "install_dir"