#!/bin/bash set -eu #================================================= # IMPORT GENERIC HELPERS #================================================= . /usr/share/yunohost/helpers #================================================= # MANAGE SCRIPT FAILURE #================================================= ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get "$app" domain) path_url=$(ynh_app_setting_get "$app" path) admin=$(ynh_app_setting_get "$app" admin) final_path=/var/www/$app #================================================= # BACKUP THE APP MAIN DIR #================================================= ynh_backup "$final_path" #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # BACKUP THE MYSQL DATABASE #================================================= ynh_mysql_dump_db "$app" > db.sql